mrc-ide / odin.dust

Compile odin to dust
https://mrc-ide.github.io/odin.dust
Other
3 stars 1 forks source link

Easy way to generate code without compilation #85

Open richfitz opened 3 years ago

richfitz commented 3 years ago

would be useful for debugging, particularly for gpu models...

currently doing:

generate <- function(path) {
  subs <- list(n_age_groups = 17, n_groups = 19,
               n_vacc_classes = 1, n_strains = 1)
  options <- odin.dust::odin_dust_options(
    verbose = TRUE, real_t = "float", rewrite_constants = TRUE,
    substitutions = subs, gpu_generate = TRUE)
  ir <- odin::odin_parse_(path, options, type = "file")
  dat <- withr::with_dir(dirname(path), odin.dust:::generate_dust(ir, options))
  odin.dust:::odin_dust_code(dat)
}