Description Usage Arguments Value Author(s) References See Also Examples
These functions allow us to use libNVVM to convert
LLVM Intermediate Representation (IR) code to PTX
code that we can use with CUDA.
These allow us to create a program object,
to add IR code to the program and to compile the code to PTX.
These are the primitives building blocks. generatePTX
uses these to implement the full sequence of converting IR code to PTX.
The functions allow us to both compile the PTX and also
to retrieve errors about the compilation (getProgramLog
).
1 2 3 4 5 6 | createProgram()
addModuleToProgram(prog, buffer, name = "", size = nchar(buffer))
compileProgram(prog, options, numOptions = length(as(options, "character")))
verifyProgram(prog, options, numOptions = length(as(options, "character")))
getCompiledResultSize(prog)
getProgramLogSize(prog)
|
prog |
a |
buffer |
a character vector containing the IR code to be converted to PTX |
name |
the name to use for the PTX module name |
size |
the number of bytes in the bufer |
options |
a character vector |
numOptions |
this should never be specified by the caller |
Each of the functions return differen information.
verifyProgram
checks whether function
Duncan Temple Lang
libNVVM
1 2 3 4 5 6 7 | f = system.file("sampleCode", "simple-gpu64.ll", package = "Rnvvm")
ir = readLines(f)
prog = createProgram()
addModuleToProgram(prog, ir, "example")
compileProgram(prog, character())
n = getCompiledResultSize(prog)
ptx = getCompiledResult(prog, n)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.