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,
  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.

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] "/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//Rtmpxf7XoZ/file1d1776500705"
#> 
#> $skip_cache
#> [1] FALSE
#> 
#> $rewrite_dims
#> [1] FALSE
#> 
#> $rewrite_constants
#> [1] FALSE
#> 
#> $substitutions
#> NULL
#> 
#> $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: 0x7ffc6258ea58>
#> <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"