prepare: GPU preparation for PolyaGamma sampling and/or Bayesian...

Description Usage Arguments Details Value See Also Examples

View source: R/LogitWrapper.R

Description

Generates the external pointer to the GPU. This function compiles the OpenCL code, creates the command queue, etc. It can be used in order to avoid compilation/creation in each call of the rpg, mlr, and lasso.

Usage

1
prepare(precision=0,device=-1, parameters=NULL )

Arguments

precision

the number of random variates to simulate.

device

the ID of the device for which to generate the helper variables.

parameters

a 9 dimensional vector of parameters to tune the GPU implementation.

Details

This is used in order to avoid unnecesarry recompilation of OpenCL kernel and creation of contexts, command queues, etc.. The output of this function is a pointer that can be passed to the mlr, lasso and rpg functions. If the pointer is not passed to these functions, the prepare function is called from inside the mlr/lasso/rpg functions in each call. If no device number is specified, a list of devices with their respective IDs will be shown and you will be prompted to enter a number. In order to tune the implementation you can specify your own values for implementation parameters, which is a 9 dimensional vector.

Value

This function returns an external pointer to a C structure for the GPU.

See Also

rpg,lasso,mlr

Examples

1
  gpu_pointer <- prepare(precision=0, device=0)

bayesCL documentation built on May 2, 2019, 3:43 p.m.

Related to prepare in bayesCL...