Options for controlling odin_dust; this is a superset of odin::odin_options

odin_dust_options(
  ...,
  real_type = NULL,
  rng_state_type = NULL,
  gpu = NULL,
  gpu_generate = NULL,
  compiler_options = NULL,
  optimisation_level = NULL,
  options = NULL
)

Arguments

...

Arguments passed to odin::odin_options, including verbose, workdir, no_check_unused_equations and rewrite_dims.

real_type

C++ type to use for real (floating point) numbers. Defaults to double.

rng_state_type

C++ type to use for the random number generator. Defaults to dust::random::generator<real_type> which selects a generator based on your real type. The default prior to dust 0.10.0 was dust::random::xoshiro256starstar_state.

gpu

Experimental! Generate support for running models on a GPU. This implies gpu_generate but does require a gpu and nvcc toolchain. Currently not supported within package code. This argument will be passed through to dust::dust() and so to enable compilation for a gpu, pass either TRUE or the results of dust::dust_cuda_options)

gpu_generate

Experimental Generate gpu support code. This does not require a gpu or nvcc toolchain, but creates code that could be compiled for a gpu. This is primarily intended for testing and development as the generated code will be slower than the normal cpu version, and the compilation time will be considerably slower. Currently not supported within package code.

compiler_options

Additional options for the C++ compiler, passed to dust::dust

optimisation_level

Shorthand control over optimisation level, passed to dust::dust. If provided should be one of none (slow running, fast building), standard or max (enables fast math)

options

An odin::odin_options or odin_dust_options object. If given it overrides arguments; if it is already a odin_dust_options object it is returned unmodified. Otherwise it is passed through to odin::odin_options where it will override arguments in ... but respond to the odin_dust specific options (real_type, etc)

Value

A list of options (class odin_options) to pass to odin.dust::odin_dust

Examples

odin.dust::odin_dust_options()
#> $validate
#> [1] FALSE
#> 
#> $verbose
#> [1] TRUE
#> 
#> $target
#> [1] "dust"
#> 
#> $pretty
#> [1] FALSE
#> 
#> $workdir
#> [1] "/tmp/RtmpVWP1Re/file19d86e95082e"
#> 
#> $skip_cache
#> [1] FALSE
#> 
#> $rewrite_dims
#> [1] FALSE
#> 
#> $rewrite_constants
#> [1] FALSE
#> 
#> $substitutions
#> NULL
#> 
#> $debug_enable
#> [1] FALSE
#> 
#> $no_check_unused_equations
#> [1] FALSE
#> 
#> $compiler_warnings
#> [1] FALSE
#> 
#> $read_include
#> function (filename) 
#> {
#>     dat <- decor::cpp_decorations(files = filename)
#>     code <- dat$context[dat$decoration == "odin.dust::register"]
#>     names <- vcapply(code, function(x) decor::parse_cpp_function(x)$name)
#>     if (length(names) == 0) {
#>         stop("Did not find any functions decorated with '[[odin.dust::register]]'")
#>     }
#>     list(names = names, data = list(source = paste(readLines(filename), 
#>         collapse = "\n")))
#> }
#> <bytecode: 0x560cd4de2860>
#> <environment: namespace:odin.dust>
#> 
#> $gpu
#> $gpu$generate
#> [1] FALSE
#> 
#> $gpu$compile
#> [1] FALSE
#> 
#> 
#> $real_type
#> [1] "double"
#> 
#> $rng_state_type
#> [1] "dust::random::generator<real_type>"
#> 
#> $config_custom
#> [1] "compare"
#> 
#> attr(,"class")
#> [1] "odin_dust_options" "odin_options"