dust_cuda_options: Create CUDA options

View source: R/cuda.R

dust_cuda_optionsR Documentation

Create CUDA options

Description

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.

Usage

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)

mrc-ide/dust documentation built on May 21, 2022, 7:57 a.m.