@@ -8,32 +8,33 @@ from libc.stdint cimport uint32_t, uint64_t
88
99
1010# ENUMS
11- cdef extern from ' <nvrtc.h>' :
12- ctypedef enum nvrtcResult:
13- NVRTC_SUCCESS
14- NVRTC_ERROR_OUT_OF_MEMORY
15- NVRTC_ERROR_PROGRAM_CREATION_FAILURE
16- NVRTC_ERROR_INVALID_INPUT
17- NVRTC_ERROR_INVALID_PROGRAM
18- NVRTC_ERROR_INVALID_OPTION
19- NVRTC_ERROR_COMPILATION
20- NVRTC_ERROR_BUILTIN_OPERATION_FAILURE
21- NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION
22- NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION
23- NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID
24- NVRTC_ERROR_INTERNAL_ERROR
25- NVRTC_ERROR_TIME_FILE_WRITE_FAILED
26- NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED
27- NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED
28- NVRTC_ERROR_PCH_CREATE
29- NVRTC_ERROR_CANCELLED
30- NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED
11+ ctypedef enum nvrtcResult " nvrtcResult" :
12+ NVRTC_SUCCESS " NVRTC_SUCCESS" = 0
13+ NVRTC_ERROR_OUT_OF_MEMORY " NVRTC_ERROR_OUT_OF_MEMORY" = 1
14+ NVRTC_ERROR_PROGRAM_CREATION_FAILURE " NVRTC_ERROR_PROGRAM_CREATION_FAILURE" = 2
15+ NVRTC_ERROR_INVALID_INPUT " NVRTC_ERROR_INVALID_INPUT" = 3
16+ NVRTC_ERROR_INVALID_PROGRAM " NVRTC_ERROR_INVALID_PROGRAM" = 4
17+ NVRTC_ERROR_INVALID_OPTION " NVRTC_ERROR_INVALID_OPTION" = 5
18+ NVRTC_ERROR_COMPILATION " NVRTC_ERROR_COMPILATION" = 6
19+ NVRTC_ERROR_BUILTIN_OPERATION_FAILURE " NVRTC_ERROR_BUILTIN_OPERATION_FAILURE" = 7
20+ NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION " NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION" = 8
21+ NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION " NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION" = 9
22+ NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID " NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID" = 10
23+ NVRTC_ERROR_INTERNAL_ERROR " NVRTC_ERROR_INTERNAL_ERROR" = 11
24+ NVRTC_ERROR_TIME_FILE_WRITE_FAILED " NVRTC_ERROR_TIME_FILE_WRITE_FAILED" = 12
25+ NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED " NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED" = 13
26+ NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED " NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED" = 14
27+ NVRTC_ERROR_PCH_CREATE " NVRTC_ERROR_PCH_CREATE" = 15
28+ NVRTC_ERROR_CANCELLED " NVRTC_ERROR_CANCELLED" = 16
29+ NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED " NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED" = 17
3130cdef enum : _NVRTCRESULT_INTERNAL_LOADING_ERROR = - 42
3231
3332
3433# TYPES
35- cdef extern from ' <nvrtc.h>' :
36- ctypedef void * nvrtcProgram ' nvrtcProgram'
34+ cdef extern from ' nvrtc.h' :
35+ ctypedef struct _nvrtcProgram:
36+ pass
37+ ctypedef _nvrtcProgram* nvrtcProgram ' nvrtcProgram'
3738
3839
3940
@@ -42,9 +43,9 @@ cdef const char* nvrtcGetErrorString(nvrtcResult result) except?NULL nogil
4243cdef nvrtcResult nvrtcVersion(int * major, int * minor) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
4344cdef nvrtcResult nvrtcGetNumSupportedArchs(int * numArchs) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
4445cdef nvrtcResult nvrtcGetSupportedArchs(int * supportedArchs) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
45- cdef nvrtcResult nvrtcCreateProgram(nvrtcProgram* prog, const char * src, const char * name, int numHeaders, const char * const * headers, const char * const * includeNames) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
46+ cdef nvrtcResult nvrtcCreateProgram(nvrtcProgram* prog, const char * src, const char * name, int numHeaders, const char ** headers, const char ** includeNames) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
4647cdef nvrtcResult nvrtcDestroyProgram(nvrtcProgram* prog) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
47- cdef nvrtcResult nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char * const * options) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
48+ cdef nvrtcResult nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char ** options) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
4849cdef nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
4950cdef nvrtcResult nvrtcGetPTX(nvrtcProgram prog, char * ptx) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
5051cdef nvrtcResult nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
@@ -55,12 +56,12 @@ cdef nvrtcResult nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet)
5556cdef nvrtcResult nvrtcGetOptiXIR(nvrtcProgram prog, char * optixir) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
5657cdef nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
5758cdef nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, char * log) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
58- cdef nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog, const char * const name_expression) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
59- cdef nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog, const char * const name_expression, const char ** lowered_name) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
59+ cdef nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog, const char * name_expression) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
60+ cdef nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog, const char * name_expression, const char ** lowered_name) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
6061cdef nvrtcResult nvrtcGetPCHHeapSize(size_t* ret) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
6162cdef nvrtcResult nvrtcSetPCHHeapSize(size_t size) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
6263cdef nvrtcResult nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
6364cdef nvrtcResult nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
64- cdef nvrtcResult nvrtcSetFlowCallback(nvrtcProgram prog, void * callback, void * payload) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
65+ cdef nvrtcResult nvrtcSetFlowCallback(nvrtcProgram prog, void * callback[] , void * payload) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
6566cdef nvrtcResult nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
6667cdef nvrtcResult nvrtcGetTileIR(nvrtcProgram prog, char * TileIR) except ?< nvrtcResult> _NVRTCRESULT_INTERNAL_LOADING_ERROR nogil
0 commit comments