public class JNvrtc extends Object
Modifier and Type | Method and Description |
---|---|
static int |
nvrtcAddNameExpression(nvrtcProgram prog,
String name_expression)
Notes the given name expression denoting a __global__ function or
function template instantiation.
|
static int |
nvrtcCompileProgram(nvrtcProgram prog,
int numOptions,
String[] options)
Compiles the given program.
|
static int |
nvrtcCreateProgram(nvrtcProgram prog,
String src,
String name,
int numHeaders,
String[] headers,
String[] includeNames)
Creates an instance of nvrtcProgram with the given input parameters,
and sets the output parameter
prog with it. |
static int |
nvrtcDestroyProgram(nvrtcProgram prog)
Destroys the given program.
|
static String |
nvrtcGetErrorString(int result)
A helper function that returns a string describing the given
nvrtcResult code, e.g., NVRTC_SUCCESS to "NVRTC_SUCCESS".
|
static int |
nvrtcGetLoweredName(nvrtcProgram prog,
String name_expression,
String[] lowered_name)
Extracts the lowered (mangled) name for a __global__ function or
function template instantiation, and updates *lowered_name to point
to it.
|
static int |
nvrtcGetProgramLog(nvrtcProgram prog,
String[] log)
Stores the log generated by the previous compilation of
prog in the memory pointed by log . |
static int |
nvrtcGetProgramLogSize(nvrtcProgram prog,
long[] logSizeRet)
Sets
logSizeRet with the size of the log generated by
the previous compilation of prog (including the
trailing NULL ) |
static int |
nvrtcGetPTX(nvrtcProgram prog,
String[] ptx)
Stores the PTX generated by the previous compilation of
prog in the memory pointed by ptx . |
static int |
nvrtcGetPTXSize(nvrtcProgram prog,
long[] ptxSizeRet)
Sets
ptxSizeRet with the size of the PTX generated by
the previous compilation of prog (including the
trailing NULL ). |
static int |
nvrtcVersion(int[] major,
int[] minor)
Sets the output parameters major and minor with the CUDA Runtime
Compilation version number.
|
static void |
setExceptionsEnabled(boolean enabled)
Enables or disables exceptions.
|
static void |
setLogLevel(LogLevel logLevel)
Set the specified log level for the JNvrtc library.
|
public static void setLogLevel(LogLevel logLevel)
logLevel
- The log level to use.public static void setExceptionsEnabled(boolean enabled)
enabled
- Whether exceptions are enabledpublic static String nvrtcGetErrorString(int result)
result
- CUDA Runtime Compilation API result code.public static int nvrtcVersion(int[] major, int[] minor)
major
- CUDA Runtime Compilation major version number.minor
- CUDA Runtime Compilation minor version number.public static int nvrtcCreateProgram(nvrtcProgram prog, String src, String name, int numHeaders, String[] headers, String[] includeNames)
prog
with it.prog
- CUDA Runtime Compilation program.src
- CUDA program source.name
- CUDA program name. name can be NULL; "default_program"
is used when name is NULL.numHeaders
- Number of headers used. numHeaders must be greater
than or equal to 0.headers
- Sources of the headers. headers can be NULL when
numHeaders is 0.includeNames
- Name of each header by which they can be included
in the CUDA program source. includeNames can be NULL when
numHeaders is 0.public static int nvrtcDestroyProgram(nvrtcProgram prog)
prog
- CUDA Runtime Compilation program.public static int nvrtcCompileProgram(nvrtcProgram prog, int numOptions, String[] options)
prog
- CUDA Runtime Compilation program.numOptions
- The number of optionsoptions
- The optionspublic static int nvrtcGetPTXSize(nvrtcProgram prog, long[] ptxSizeRet)
ptxSizeRet
with the size of the PTX generated by
the previous compilation of prog
(including the
trailing NULL
).prog
- CUDA Runtime Compilation program.ptxSizeRetSize
- of the generated PTX (including the trailing NULL).nvrtcGetPTX(nvrtcProgram, String[])
public static int nvrtcGetPTX(nvrtcProgram prog, String[] ptx)
prog
in the memory pointed by ptx
.prog
- CUDA Runtime Compilation program.ptx
- Compiled resultnvrtcGetPTXSize(nvrtcProgram, long[])
public static int nvrtcGetProgramLogSize(nvrtcProgram prog, long[] logSizeRet)
logSizeRet
with the size of the log generated by
the previous compilation of prog
(including the
trailing NULL
)prog
- CUDA Runtime Compilation program.logSizeRet
- Size of the compilation log (including the trailing
NULL
).nvrtcGetProgramLog(nvrtcProgram, String[])
public static int nvrtcGetProgramLog(nvrtcProgram prog, String[] log)
prog
in the memory pointed by log
.prog
- CUDA Runtime Compilation program.log
- Compilation lognvrtcGetProgramLogSize(nvrtcProgram, long[])
public static int nvrtcAddNameExpression(nvrtcProgram prog, String name_expression)
prog
- CUDA Runtime Compilation program.name_expression
- constant expression denoting a __global__
function or function template instantiation.nvrtcGetLoweredName(jcuda.nvrtc.nvrtcProgram, java.lang.String, java.lang.String[])
public static int nvrtcGetLoweredName(nvrtcProgram prog, String name_expression, String[] lowered_name)
prog
- CUDA Runtime Compilation program.name_expression
- constant expression denoting a __global__
function or function template instantiation.lowered_name
- initialized by the function to point to a
C string containing the lowered (mangled) name corresponding
to the provided name expression.nvrtcAddNameExpression(jcuda.nvrtc.nvrtcProgram, java.lang.String)
Copyright © 2020. All rights reserved.