dust_generate | R Documentation |
Generate a package out of a dust model. The resulting package can
be installed or loaded via pkgload::load_all()
though it
contains minimal metadata and if you want to create a persistent
package you should use dust_package()
. This function is
intended for cases where you either want to inspect the code or
generate it once and load multiple times (useful in some workflows
with CUDA models).
dust_generate( filename, quiet = FALSE, workdir = NULL, gpu = FALSE, real_type = NULL, mangle = FALSE )
filename |
The path to a single C++ file |
quiet |
Logical, indicating if compilation messages from
|
workdir |
Optional working directory to use. If |
gpu |
Logical, indicating if we should generate GPU
code. This requires a considerable amount of additional software
installed (CUDA toolkit and drivers) as well as a
CUDA-compatible GPU. If |
real_type |
Optionally, a string indicating a substitute type to
swap in for your model's |
mangle |
Logical, indicating if the model name should be
mangled when creating the package. This is safer if you will
load multiple copies of the package into a single session, but
is |
The path to the generated package (will be workdir
if
that was provided, otherwise a temporary directory).
filename <- system.file("examples/walk.cpp", package = "dust") path <- dust::dust_generate(filename) # Simple package created: dir(path) dir(file.path(path, "R")) dir(file.path(path, "src"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.