cuda.nvrtc#
- Attributes:
- HIP_PYTHON (
bool): True.- hip_python_mod (module):
A reference to the module
hip.hiprtc.- hiprtc (module):
A reference to the module
hip.hiprtc.- HIP_PYTHON_nvrtcResult_HALLUCINATE:
Make
nvrtcResulthallucinate values for non-existing enum constants. Disabled by default if default is not modified via environment variable.Default value can be set/unset via environment variable
HIP_PYTHON_nvrtcResult_HALLUCINATE.- HIP_PYTHON_CUjitInputType_HALLUCINATE:
Make
CUjitInputTypehallucinate values for non-existing enum constants. Disabled by default if default is not modified via environment variable.Default value can be set/unset via environment variable
HIP_PYTHON_CUjitInputType_HALLUCINATE.- HIP_PYTHON_CUjitInputType_enum_HALLUCINATE:
Make
CUjitInputType_enumhallucinate values for non-existing enum constants. Disabled by default if default is not modified via environment variable.Default value can be set/unset via environment variable
HIP_PYTHON_CUjitInputType_enum_HALLUCINATE.- CUlinkState:
Alias of
hiprtcLinkState- nvrtcGetErrorString:
Alias of
hiprtcGetErrorString- nvrtcVersion:
Alias of
hiprtcVersion- nvrtcProgram:
Alias of
hiprtcProgram- nvrtcAddNameExpression:
Alias of
hiprtcAddNameExpression- nvrtcCompileProgram:
Alias of
hiprtcCompileProgram- nvrtcCreateProgram:
Alias of
hiprtcCreateProgram- nvrtcDestroyProgram:
Alias of
hiprtcDestroyProgram- nvrtcGetLoweredName:
Alias of
hiprtcGetLoweredName- nvrtcGetProgramLog:
Alias of
hiprtcGetProgramLog- nvrtcGetProgramLogSize:
Alias of
hiprtcGetProgramLogSize- nvrtcGetPTX:
Alias of
hiprtcGetCode- nvrtcGetPTXSize:
Alias of
hiprtcGetCodeSize- nvrtcGetCUBIN:
Alias of
hiprtcGetBitcode- nvrtcGetCUBINSize:
Alias of
hiprtcGetBitcodeSize- cuLinkCreate:
Alias of
hiprtcLinkCreate- cuLinkCreate_v2:
Alias of
hiprtcLinkCreate- cuLinkAddFile:
Alias of
hiprtcLinkAddFile- cuLinkAddFile_v2:
Alias of
hiprtcLinkAddFile- cuLinkAddData:
Alias of
hiprtcLinkAddData- cuLinkAddData_v2:
Alias of
hiprtcLinkAddData- cuLinkComplete:
Alias of
hiprtcLinkComplete- cuLinkDestroy:
Alias of
hiprtcLinkDestroy
- HIP_PYTHON (
- class cuda.nvrtc.nvrtcResult(value)
Bases:
_hiprtcResult__BaseAn enumeration.
- HIPRTC_SUCCESS = 0
- NVRTC_SUCCESS = 0
- HIPRTC_ERROR_OUT_OF_MEMORY = 1
- NVRTC_ERROR_OUT_OF_MEMORY = 1
- HIPRTC_ERROR_PROGRAM_CREATION_FAILURE = 2
- NVRTC_ERROR_PROGRAM_CREATION_FAILURE = 2
- HIPRTC_ERROR_INVALID_INPUT = 3
- NVRTC_ERROR_INVALID_INPUT = 3
- HIPRTC_ERROR_INVALID_PROGRAM = 4
- NVRTC_ERROR_INVALID_PROGRAM = 4
- HIPRTC_ERROR_INVALID_OPTION = 5
- NVRTC_ERROR_INVALID_OPTION = 5
- HIPRTC_ERROR_COMPILATION = 6
- NVRTC_ERROR_COMPILATION = 6
- HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7
- NVRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7
- HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8
- NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8
- HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9
- NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9
- HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10
- NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10
- HIPRTC_ERROR_INTERNAL_ERROR = 11
- NVRTC_ERROR_INTERNAL_ERROR = 11
- HIPRTC_ERROR_LINKING = 100
- class cuda.nvrtc.CUjitInputType(value)
Bases:
_hiprtcJITInputType__BaseAn enumeration.
- HIPRTC_JIT_INPUT_CUBIN = 0
- CU_JIT_INPUT_CUBIN = 0
- HIPRTC_JIT_INPUT_PTX = 1
- CU_JIT_INPUT_PTX = 1
- HIPRTC_JIT_INPUT_FATBINARY = 2
- CU_JIT_INPUT_FATBINARY = 2
- HIPRTC_JIT_INPUT_OBJECT = 3
- CU_JIT_INPUT_OBJECT = 3
- HIPRTC_JIT_INPUT_LIBRARY = 4
- CU_JIT_INPUT_LIBRARY = 4
- HIPRTC_JIT_INPUT_NVVM = 5
- CU_JIT_INPUT_NVVM = 5
- HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES = 6
- CU_JIT_NUM_INPUT_TYPES = 6
- HIPRTC_JIT_INPUT_LLVM_BITCODE = 100
- HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE = 101
- HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE = 102
- HIPRTC_JIT_NUM_INPUT_TYPES = 9
- class cuda.nvrtc.CUjitInputType_enum(value)
Bases:
_hiprtcJITInputType__BaseAn enumeration.
- HIPRTC_JIT_INPUT_CUBIN = 0
- CU_JIT_INPUT_CUBIN = 0
- HIPRTC_JIT_INPUT_PTX = 1
- CU_JIT_INPUT_PTX = 1
- HIPRTC_JIT_INPUT_FATBINARY = 2
- CU_JIT_INPUT_FATBINARY = 2
- HIPRTC_JIT_INPUT_OBJECT = 3
- CU_JIT_INPUT_OBJECT = 3
- HIPRTC_JIT_INPUT_LIBRARY = 4
- CU_JIT_INPUT_LIBRARY = 4
- HIPRTC_JIT_INPUT_NVVM = 5
- CU_JIT_INPUT_NVVM = 5
- HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES = 6
- CU_JIT_NUM_INPUT_TYPES = 6
- HIPRTC_JIT_INPUT_LLVM_BITCODE = 100
- HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE = 101
- HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE = 102
- HIPRTC_JIT_NUM_INPUT_TYPES = 9
- class cuda.nvrtc.CUlinkState_st
Bases:
ihiprtcLinkState
- cuda.nvrtc.CUlinkState
alias of
ihiprtcLinkState
- cuda.nvrtc.nvrtcGetErrorString(result)
hiprtcGetErrorString(result) Returns text string message to explain the error which occurred
- Warning:
In HIP, this function returns the name of the error, if the hiprtc result is defined, it will return “Invalid HIPRTC error code”
- See:
- Args:
- result (
hiprtcResult) – IN: code to convert to string.
- result (
- Returns:
A
tupleof size 1 that contains (in that order):bytes: const char pointer to the NULL-terminated error string
- cuda.nvrtc.nvrtcVersion()
hiprtcVersion() Sets the parameters as major and minor version.
- cuda.nvrtc.nvrtcProgram
alias of
_hiprtcProgram
- cuda.nvrtc.nvrtcAddNameExpression(prog, name_expression)
hiprtcAddNameExpression(prog, name_expression) Adds the given name exprssion to the runtime compilation program.
If const char pointer is NULL, it will return
HIPRTC_ERROR_INVALID_INPUT.- See:
- Args:
- Returns:
A
tupleof size 1 that contains (in that order):
- cuda.nvrtc.nvrtcCompileProgram(prog, numOptions, options)
hiprtcCompileProgram(prog, int numOptions, options) Compiles the given runtime compilation program.
If the compiler failed to build the runtime compilation program, it will return
HIPRTC_ERROR_COMPILATION.- See:
- Args:
- prog (
_hiprtcProgram/object) – IN: runtime compilation program instance.
- numOptions (
int) – IN: number of compiler options.
- options (
ListOfBytes/object) – IN: compiler options as const array of strins.
- prog (
- Returns:
A
tupleof size 1 that contains (in that order):
- cuda.nvrtc.nvrtcCreateProgram(src, name, numHeaders, headers, includeNames)
hiprtcCreateProgram(src, name, int numHeaders, headers, includeNames) Creates an instance of hiprtcProgram with the given input parameters,
and sets the output hiprtcProgram prog with it.
Any invalide input parameter, it will return
HIPRTC_ERROR_INVALID_INPUTorHIPRTC_ERROR_INVALID_PROGRAM.If failed to create the program, it will return
HIPRTC_ERROR_PROGRAM_CREATION_FAILURE.- See:
- Args:
- src (
CStr/object) – IN: const char pointer to the program source.
- name (
CStr/object) – IN: const char pointer to the program name.
- numHeaders (
int) – IN: number of headers.
- headers (
ListOfBytes/object) – IN: array of strings pointing to headers.
- includeNames (
ListOfBytes/object) – IN: array of strings pointing to names included in program source.
- src (
- Returns:
A
tupleof size 2 that contains (in that order):_hiprtcProgram:runtime compilation program instance.
- cuda.nvrtc.nvrtcDestroyProgram(prog)
hiprtcDestroyProgram(prog) Destroys an instance of given hiprtcProgram.
If prog is NULL, it will return
HIPRTC_ERROR_INVALID_INPUT.- See:
- Args:
- Returns:
A
tupleof size 1 that contains (in that order):
- cuda.nvrtc.nvrtcGetLoweredName(prog, name_expression)
hiprtcGetLoweredName(prog, name_expression) Gets the lowered (mangled) name from an instance of hiprtcProgram with the given input parameters,
and sets the output lowered_name with it.
If any invalide nullptr input parameters, it will return
HIPRTC_ERROR_INVALID_INPUTIf name_expression is not found, it will return
HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALIDIf failed to get lowered_name from the program, it will return
HIPRTC_ERROR_COMPILATION.- See:
- Args:
- Returns:
A
tupleof size 2 that contains (in that order):
- cuda.nvrtc.nvrtcGetProgramLog(prog, log)
hiprtcGetProgramLog(prog, log) Gets the log generated by the runtime compilation program instance.
- See:
- Args:
- Returns:
A
tupleof size 1 that contains (in that order):
- cuda.nvrtc.nvrtcGetProgramLogSize(prog)
hiprtcGetProgramLogSize(prog) Gets the size of log generated by the runtime compilation program instance.
- cuda.nvrtc.nvrtcGetPTX(prog, code)
hiprtcGetCode(prog, code) Gets the pointer of compilation binary by the runtime compilation program instance.
- See:
- Args:
- Returns:
A
tupleof size 1 that contains (in that order):
- cuda.nvrtc.nvrtcGetPTXSize(prog)
hiprtcGetCodeSize(prog) Gets the size of compilation binary by the runtime compilation program instance.
- cuda.nvrtc.nvrtcGetCUBIN(prog, bitcode)
hiprtcGetBitcode(prog, bitcode) Gets the pointer of compiled bitcode by the runtime compilation program instance.
- See:
- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hiprtcResult: HIPRTC_SUCCESS
- cuda.nvrtc.nvrtcGetCUBINSize(prog)
hiprtcGetBitcodeSize(prog) Gets the size of compiled bitcode by the runtime compilation program instance.
- cuda.nvrtc.cuLinkCreate(num_options, option_ptr, option_vals_pptr)
hiprtcLinkCreate(unsigned int num_options, option_ptr, option_vals_pptr) Creates the link instance via hiprtc APIs.
- See:
- Args:
- num_options (
int) – IN: Number of options
- option_ptr (
HiprtcLinkCreate_option_ptr/object) – IN: Array of options
- option_vals_pptr (
ListOfPointer/object) – IN: Array of option values cast to void*
- num_options (
- Returns:
A
tupleof size 2 that contains (in that order):hiprtcResult:HIPRTC_SUCCESS,HIPRTC_ERROR_INVALID_INPUT,HIPRTC_ERROR_INVALID_OPTIONihiprtcLinkState:hiprtc link state created upon success
- cuda.nvrtc.cuLinkCreate_v2(num_options, option_ptr, option_vals_pptr)
hiprtcLinkCreate(unsigned int num_options, option_ptr, option_vals_pptr) Creates the link instance via hiprtc APIs.
- See:
- Args:
- num_options (
int) – IN: Number of options
- option_ptr (
HiprtcLinkCreate_option_ptr/object) – IN: Array of options
- option_vals_pptr (
ListOfPointer/object) – IN: Array of option values cast to void*
- num_options (
- Returns:
A
tupleof size 2 that contains (in that order):hiprtcResult:HIPRTC_SUCCESS,HIPRTC_ERROR_INVALID_INPUT,HIPRTC_ERROR_INVALID_OPTIONihiprtcLinkState:hiprtc link state created upon success
- cuda.nvrtc.cuLinkAddFile(hip_link_state, input_type, file_path, num_options, options_ptr, option_values)
hiprtcLinkAddFile(hip_link_state, input_type, file_path, unsigned int num_options, options_ptr, option_values) Adds a file with bit code to be linked with options
If input values are invalid, it will
- See:
- Args:
- hip_link_state (
ihiprtcLinkState/object) – IN: hiprtc link state
- input_type (
hiprtcJITInputType) – IN: Type of the input data or bitcode
- file_path (
CStr/object) – IN: Path to the input file where bitcode is present
- num_options (
int) – IN: Size of the options
- options_ptr (
Pointer/object) – IN: Array of options applied to this input
- option_values (
Pointer/object) – IN: Array of option values cast to void*
- hip_link_state (
- Returns:
A
tupleof size 1 that contains (in that order):
- cuda.nvrtc.cuLinkAddFile_v2(hip_link_state, input_type, file_path, num_options, options_ptr, option_values)
hiprtcLinkAddFile(hip_link_state, input_type, file_path, unsigned int num_options, options_ptr, option_values) Adds a file with bit code to be linked with options
If input values are invalid, it will
- See:
- Args:
- hip_link_state (
ihiprtcLinkState/object) – IN: hiprtc link state
- input_type (
hiprtcJITInputType) – IN: Type of the input data or bitcode
- file_path (
CStr/object) – IN: Path to the input file where bitcode is present
- num_options (
int) – IN: Size of the options
- options_ptr (
Pointer/object) – IN: Array of options applied to this input
- option_values (
Pointer/object) – IN: Array of option values cast to void*
- hip_link_state (
- Returns:
A
tupleof size 1 that contains (in that order):
- cuda.nvrtc.cuLinkAddData(hip_link_state, input_type, image, image_size, name, num_options, options_ptr, option_values)
hiprtcLinkAddData(hip_link_state, input_type, image, unsigned long image_size, name, unsigned int num_options, options_ptr, option_values) Completes the linking of the given program.
If adding the file fails, it will
- See:
- Args:
- hip_link_state (
ihiprtcLinkState/object) – IN: hiprtc link state
- input_type (
hiprtcJITInputType) – IN: Type of the input data or bitcode
- image (
Pointer/object) – IN: Input data which is null terminated
- image_size (
int) – IN: Size of the input data
- name (
CStr/object) – IN: Optional name for this input
- num_options (
int) – IN: Size of the options
- options_ptr (
Pointer/object) – IN: Array of options applied to this input
- option_values (
Pointer/object) – IN: Array of option values cast to void*
- hip_link_state (
- Returns:
A
tupleof size 1 that contains (in that order):
- cuda.nvrtc.cuLinkAddData_v2(hip_link_state, input_type, image, image_size, name, num_options, options_ptr, option_values)
hiprtcLinkAddData(hip_link_state, input_type, image, unsigned long image_size, name, unsigned int num_options, options_ptr, option_values) Completes the linking of the given program.
If adding the file fails, it will
- See:
- Args:
- hip_link_state (
ihiprtcLinkState/object) – IN: hiprtc link state
- input_type (
hiprtcJITInputType) – IN: Type of the input data or bitcode
- image (
Pointer/object) – IN: Input data which is null terminated
- image_size (
int) – IN: Size of the input data
- name (
CStr/object) – IN: Optional name for this input
- num_options (
int) – IN: Size of the options
- options_ptr (
Pointer/object) – IN: Array of options applied to this input
- option_values (
Pointer/object) – IN: Array of option values cast to void*
- hip_link_state (
- Returns:
A
tupleof size 1 that contains (in that order):
- cuda.nvrtc.cuLinkComplete(hip_link_state)
hiprtcLinkComplete(hip_link_state) Completes the linking of the given program.
If adding the data fails, it will
- See:
- Args:
- hip_link_state (
ihiprtcLinkState/object) – IN: hiprtc link state
- hip_link_state (
- Returns:
A
tupleof size 3 that contains (in that order):
- cuda.nvrtc.cuLinkDestroy(hip_link_state)
hiprtcLinkDestroy(hip_link_state) Deletes the link instance via hiprtc APIs.
- See:
- Args:
- hip_link_state (
ihiprtcLinkState/object) – IN: link state instance
- hip_link_state (
- Returns:
A
tupleof size 1 that contains (in that order):