Create options for compiling for CUDA. Unless you need to change paths to libraries/headers, or change the debug level you will probably not need to directly use this. However, it's potentially useful to see what is being passed to the compiler.

dust_cuda_options(
  ...,
  debug = FALSE,
  profile = FALSE,
  fast_math = FALSE,
  flags = NULL
)

Arguments

...

Arguments passed to dust_cuda_configuration()

debug

Logical, indicating if we should compile for debug (adding -g, -G and -O0)

profile

Logical, indicating if we should enable profiling

fast_math

Logical, indicating if we should enable "fast maths", which lets the optimiser enable optimisations that break IEEE compliance and disables some error checking (see the CUDA docs for more details).

flags

Optional extra arguments to pass to nvcc. These options will not be passed to your normal C++ compiler, nor the linker (for that use R's user Makevars system). This can be used to do things like tune the maximum number of registers (--maxrregcount x). If not NULL, this must be a character vector, which will be concatenated with spaces between options.

Value

An object of type cuda_options, which can be passed into dust as argument gpu

See also

dust_cuda_configuration which identifies and returns the core CUDA configuration (often used implicitly by this function).

Examples

tryCatch(
  dust::dust_cuda_options(),
  error = function(e) NULL)
#> NULL