nvjitlink#
Note#
The nvjitlink bindings are not supported on nvJitLink installations <12.3. Ensure the installed CUDA toolkit’s nvJitLink version is >=12.3.
Functions#
NvJitLink defines the following functions for linking code objects and querying the info and error logs.
- cuda.bindings.nvjitlink.create(uint32_t num_options, options) intptr_t#
nvJitLinkCreate creates an instance of nvJitLinkHandle with the given input options, and sets the output parameter ``handle``. :param num_options: Number of options passed. :type num_options: uint32_t :param options: Array of size ``num_options`` of option strings. It can be: - an :class:`int` as the pointer address to the nested sequence, or - a Python sequence of :class:`int`\s, each of which is a pointer address to a valid sequence of 'char', or - a nested Python sequence of ``str``. :type options: object :returns: Address of nvJitLink handle. :rtype: intptr_t .. seealso:: `nvJitLinkCreate`
- cuda.bindings.nvjitlink.destroy(intptr_t handle)#
nvJitLinkDestroy frees the memory associated with the given handle. :param handle: nvJitLink handle. :type handle: intptr_t .. seealso:: `nvJitLinkDestroy`
- cuda.bindings.nvjitlink.add_data(intptr_t handle, int input_type, data, size_t size, name)#
nvJitLinkAddData adds data image to the link. :param handle: nvJitLink handle. :type handle: intptr_t :param input_type: kind of input. :type input_type: InputType :param data: pointer to data image in memory. :type data: bytes :param size: size of the data. :type size: size_t :param name: name of input object. :type name: str .. seealso:: `nvJitLinkAddData`
- cuda.bindings.nvjitlink.add_file(intptr_t handle, int input_type, file_name)#
nvJitLinkAddFile reads data from file and links it in. :param handle: nvJitLink handle. :type handle: intptr_t :param input_type: kind of input. :type input_type: InputType :param file_name: name of file. :type file_name: str .. seealso:: `nvJitLinkAddFile`
- cuda.bindings.nvjitlink.complete(intptr_t handle)#
nvJitLinkComplete does the actual link. :param handle: nvJitLink handle. :type handle: intptr_t .. seealso:: `nvJitLinkComplete`
- cuda.bindings.nvjitlink.get_linked_cubin_size(intptr_t handle) size_t#
nvJitLinkGetLinkedCubinSize gets the size of the linked cubin. :param handle: nvJitLink handle. :type handle: intptr_t :returns: Size of the linked cubin. :rtype: size_t .. seealso:: `nvJitLinkGetLinkedCubinSize`
- cuda.bindings.nvjitlink.get_linked_cubin(intptr_t handle, cubin)#
nvJitLinkGetLinkedCubin gets the linked cubin. :param handle: nvJitLink handle. :type handle: intptr_t :param cubin: The linked cubin. :type cubin: bytes .. seealso:: `nvJitLinkGetLinkedCubin`
- cuda.bindings.nvjitlink.get_linked_ptx_size(intptr_t handle) size_t#
nvJitLinkGetLinkedPtxSize gets the size of the linked ptx. :param handle: nvJitLink handle. :type handle: intptr_t :returns: Size of the linked PTX. :rtype: size_t .. seealso:: `nvJitLinkGetLinkedPtxSize`
- cuda.bindings.nvjitlink.get_linked_ptx(intptr_t handle, ptx)#
nvJitLinkGetLinkedPtx gets the linked ptx. :param handle: nvJitLink handle. :type handle: intptr_t :param ptx: The linked PTX. :type ptx: bytes .. seealso:: `nvJitLinkGetLinkedPtx`
- cuda.bindings.nvjitlink.get_error_log_size(intptr_t handle) size_t#
nvJitLinkGetErrorLogSize gets the size of the error log. :param handle: nvJitLink handle. :type handle: intptr_t :returns: Size of the error log. :rtype: size_t .. seealso:: `nvJitLinkGetErrorLogSize`
- cuda.bindings.nvjitlink.get_error_log(intptr_t handle, log)#
nvJitLinkGetErrorLog puts any error messages in the log. :param handle: nvJitLink handle. :type handle: intptr_t :param log: The error log. :type log: bytes .. seealso:: `nvJitLinkGetErrorLog`
- cuda.bindings.nvjitlink.get_info_log_size(intptr_t handle) size_t#
nvJitLinkGetInfoLogSize gets the size of the info log. :param handle: nvJitLink handle. :type handle: intptr_t :returns: Size of the info log. :rtype: size_t .. seealso:: `nvJitLinkGetInfoLogSize`
- cuda.bindings.nvjitlink.get_info_log(intptr_t handle, log)#
nvJitLinkGetInfoLog puts any info messages in the log. :param handle: nvJitLink handle. :type handle: intptr_t :param log: The info log. :type log: bytes .. seealso:: `nvJitLinkGetInfoLog`
Types#
- class cuda.bindings.nvjitlink.Result(value: int)#
The enumerated type nvJitLinkResult defines API call result codes. nvJitLink APIs return nvJitLinkResult codes to indicate the result. See `nvJitLinkResult`.
- SUCCESS = <Result.SUCCESS: 0>#
- ERROR_UNRECOGNIZED_OPTION = <Result.ERROR_UNRECOGNIZED_OPTION: 1>#
- ERROR_MISSING_ARCH = <Result.ERROR_MISSING_ARCH: 2>#
- ERROR_INVALID_INPUT = <Result.ERROR_INVALID_INPUT: 3>#
- ERROR_PTX_COMPILE = <Result.ERROR_PTX_COMPILE: 4>#
- ERROR_NVVM_COMPILE = <Result.ERROR_NVVM_COMPILE: 5>#
- ERROR_INTERNAL = <Result.ERROR_INTERNAL: 6>#
- ERROR_THREADPOOL = <Result.ERROR_THREADPOOL: 7>#
- ERROR_UNRECOGNIZED_INPUT = <Result.ERROR_UNRECOGNIZED_INPUT: 8>#
- ERROR_FINALIZE = <Result.ERROR_FINALIZE: 9>#
- class cuda.bindings.nvjitlink.InputType(value: int)#
The enumerated type nvJitLinkInputType defines the kind of inputs that can be passed to nvJitLinkAdd* APIs. See `nvJitLinkInputType`.
- NONE = <InputType.NONE: 0>#
- CUBIN = <InputType.CUBIN: 1>#
- PTX = <InputType.PTX: 2>#
- LTOIR = <InputType.LTOIR: 3>#
- FATBIN = <InputType.FATBIN: 4>#
- OBJECT = <InputType.OBJECT: 5>#
- LIBRARY = <InputType.LIBRARY: 6>#
- INDEX = <InputType.INDEX: 7>#
- ANY = <InputType.ANY: 10>#