Class NVRTCNativeMethods
Inheritance
Inherited Members
Namespace: ManagedCuda.NVRTC
Assembly: NVRTC.dll
Syntax
public static class NVRTCNativeMethods
Methods
nvrtcAddNameExpression(nvrtcProgram, String)
nvrtcAddNameExpression notes the given name expression denoting a global function or function template instantiation.
The identical name expression string must be provided on a subsequent call to nvrtcGetLoweredName to extract the lowered name.
Declaration
public static nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog, string name_expression)
Parameters
Type | Name | Description |
---|---|---|
nvrtcProgram | prog | CUDA Runtime Compilation program. |
System.String | name_expression | constant expression denoting a global function or function template instantiation. |
Returns
Type | Description |
---|---|
nvrtcResult |
nvrtcCompileProgram(nvrtcProgram, Int32, IntPtr[])
compiles the given program.
Declaration
public static nvrtcResult nvrtcCompileProgram(nvrtcProgram prog, int numOptions, IntPtr[] options)
Parameters
Type | Name | Description |
---|---|---|
nvrtcProgram | prog | CUDA Runtime Compiler program. |
System.Int32 | numOptions | Number of compiler options passed. |
System.IntPtr[] | options | Compiler options in the form of C string array. options can be NULL when numOptions is 0. |
Returns
Type | Description |
---|---|
nvrtcResult |
nvrtcCreateProgram(ref nvrtcProgram, String, String, Int32, IntPtr[], IntPtr[])
creates an instance of ::nvrtcProgram with the given input parameters, and sets the output parameter \p prog with it.
Declaration
public static nvrtcResult nvrtcCreateProgram(ref nvrtcProgram prog, string src, string name, int numHeaders, IntPtr[] headers, IntPtr[] includeNames)
Parameters
Type | Name | Description |
---|---|---|
nvrtcProgram | prog | CUDA Runtime Compiler program. |
System.String | src | CUDA program source. |
System.String | name | CUDA program name. name can be NULL; "default_program" is used when name is NULL. |
System.Int32 | numHeaders | Number of headers used. numHeaders must be greater than or equal to 0. |
System.IntPtr[] | headers | Sources of the headers. headers can be NULL when numHeaders is 0. |
System.IntPtr[] | includeNames | Name of each header by which they can be included in the CUDA program source. includeNames can be NULL when numHeaders is 0. |
Returns
Type | Description |
---|---|
nvrtcResult |
nvrtcDestroyProgram(ref nvrtcProgram)
destroys the given program.
Declaration
public static nvrtcResult nvrtcDestroyProgram(ref nvrtcProgram prog)
Parameters
Type | Name | Description |
---|---|---|
nvrtcProgram | prog | CUDA Runtime Compiler program. |
Returns
Type | Description |
---|---|
nvrtcResult |
nvrtcGetErrorString(nvrtcResult)
helper function that stringifies the given #nvrtcResult code, e.g., NVRTC_SUCCESS to "NVRTC_SUCCESS". For unrecognized enumeration values, it returns "NVRTC_ERROR unknown"
Declaration
public static string nvrtcGetErrorString(nvrtcResult result)
Parameters
Type | Name | Description |
---|---|---|
nvrtcResult | result | CUDA Runtime Compiler API result code. |
Returns
Type | Description |
---|---|
System.String | Message string for the given nvrtcResult code. |
nvrtcGetLoweredName(nvrtcProgram, String, ref IntPtr)
nvrtcGetLoweredName extracts the lowered (mangled) name for a global function or function template instantiation, and updates *lowered_name to point to it. The memory containing the name is released when the NVRTC program is destroyed by nvrtcDestroyProgram.
The identical name expression must have been previously provided to nvrtcAddNameExpression.
Declaration
public static nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog, string name_expression, ref IntPtr lowered_name)
Parameters
Type | Name | Description |
---|---|---|
nvrtcProgram | prog | CUDA Runtime Compilation program. |
System.String | name_expression | constant expression denoting a global function or function template instantiation. |
System.IntPtr | lowered_name | initialized by the function to point to a C string containing the lowered (mangled) name corresponding to the provided name expression. |
Returns
Type | Description |
---|---|
nvrtcResult |
nvrtcGetProgramLog(nvrtcProgram, Byte[])
stores the log generated by the previous compilation of prog in the memory pointed by log.
Declaration
public static nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, byte[] log)
Parameters
Type | Name | Description |
---|---|---|
nvrtcProgram | prog | CUDA Runtime Compiler program. |
System.Byte[] | log | Compilation log. |
Returns
Type | Description |
---|---|
nvrtcResult |
nvrtcGetProgramLogSize(nvrtcProgram, ref SizeT)
sets logSizeRet with the size of the log generated by the previous compilation of prog (including the trailing NULL).
Declaration
public static nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, ref SizeT logSizeRet)
Parameters
Type | Name | Description |
---|---|---|
nvrtcProgram | prog | CUDA Runtime Compiler program. |
SizeT | logSizeRet | Size of the compilation log (including the trailing NULL). |
Returns
Type | Description |
---|---|
nvrtcResult |
nvrtcGetPTX(nvrtcProgram, Byte[])
stores the PTX generated by the previous compilation of prog in the memory pointed by ptx.
Declaration
public static nvrtcResult nvrtcGetPTX(nvrtcProgram prog, byte[] ptx)
Parameters
Type | Name | Description |
---|---|---|
nvrtcProgram | prog | CUDA Runtime Compiler program. |
System.Byte[] | ptx | Compiled result. |
Returns
Type | Description |
---|---|
nvrtcResult |
nvrtcGetPTXSize(nvrtcProgram, ref SizeT)
sets \p ptxSizeRet with the size of the PTX generated by the previous compilation of prog (including the trailing NULL).
Declaration
public static nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, ref SizeT ptxSizeRet)
Parameters
Type | Name | Description |
---|---|---|
nvrtcProgram | prog | CUDA Runtime Compiler program. |
SizeT | ptxSizeRet | Size of the generated PTX (including the trailing NULL). |
Returns
Type | Description |
---|---|
nvrtcResult |
nvrtcVersion(ref Int32, ref Int32)
sets the output parameters \p major and \p minor with the CUDA Runtime Compiler version number.
Declaration
public static nvrtcResult nvrtcVersion(ref int major, ref int minor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | major | CUDA Runtime Compiler major version number. |
System.Int32 | minor | CUDA Runtime Compiler minor version number. |
Returns
Type | Description |
---|---|
nvrtcResult |