Description Usage Arguments Value Author(s) References See Also
These functions and objects allow us to compile an R function into PTX code so that it can be used as a GPU kernel, i.e. run on a GPU.
compileGPUKernel
maps the R code to GPU instructions.
ModuleForNVVM
creates an LLVM Module for housing Functions and
variables. This sets the appropriate information for the Module to be
used for a Nvidia GPU, setting the data layout information for the
different basic data types.
setGPUKernel
adds an nnvm.annotations
attribute to each of the
functions. This is used by libNVVM when creating the final usable code
for the GPU.
fixPTXCodeForNVVM
is used to post-process generated code
so that it can be then used by the libNVVM mechanism.
1 2 3 4 5 | compileGPUKernel(fun, types, module = ModuleForNVVM(name), name = NULL,
.compilerHandlers = getGPUCompilerHandlers(), .insertReturn = TRUE,
.builtInRoutines = getGPUBuiltInRoutines(), .useFloat = TRUE, ...)
fixPTXCodeForNVVM(code)
setGPUKernel(funs, module)
|
fun |
the R function to map to GPU instructions |
types |
type information for the parameters and return value |
module |
the LLVM module in which the Function is to be (or was)
created. For |
name |
the name of the newly created LLVM/compiled Function |
.compilerHandlers |
the collection of "methods"/functions that constitute the compiler. These handle the different constructs in the R code and map them to GPU |
.insertReturn |
a logical value controlling whether we should
pre-process the R code to insert the explicit |
.builtInRoutines |
a list describing built-in routines that may be referenced. |
.useFloat |
a logical value. This controls whether we use double or float data type for numeric variables. |
... |
additional arguments passed directly to
|
code |
a character string containing the PTX code generated by compiling code for the GPU |
funs |
a list of LLVM Function objects |
The newly created Function
object, i.e. the LLVM routine.
Duncan Temple Lang
LLVM, libNVVM
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.