Class nvrtc

    • Field Detail

      • NVRTC_ERROR_OUT_OF_MEMORY

        public static final int NVRTC_ERROR_OUT_OF_MEMORY
        enum nvrtcResult
        See Also:
        Constant Field Values
      • NVRTC_ERROR_PROGRAM_CREATION_FAILURE

        public static final int NVRTC_ERROR_PROGRAM_CREATION_FAILURE
        enum nvrtcResult
        See Also:
        Constant Field Values
      • NVRTC_ERROR_INVALID_INPUT

        public static final int NVRTC_ERROR_INVALID_INPUT
        enum nvrtcResult
        See Also:
        Constant Field Values
      • NVRTC_ERROR_INVALID_PROGRAM

        public static final int NVRTC_ERROR_INVALID_PROGRAM
        enum nvrtcResult
        See Also:
        Constant Field Values
      • NVRTC_ERROR_INVALID_OPTION

        public static final int NVRTC_ERROR_INVALID_OPTION
        enum nvrtcResult
        See Also:
        Constant Field Values
      • NVRTC_ERROR_COMPILATION

        public static final int NVRTC_ERROR_COMPILATION
        enum nvrtcResult
        See Also:
        Constant Field Values
      • NVRTC_ERROR_BUILTIN_OPERATION_FAILURE

        public static final int NVRTC_ERROR_BUILTIN_OPERATION_FAILURE
        enum nvrtcResult
        See Also:
        Constant Field Values
      • NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION

        public static final int NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION
        enum nvrtcResult
        See Also:
        Constant Field Values
      • NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION

        public static final int NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION
        enum nvrtcResult
        See Also:
        Constant Field Values
      • NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID

        public static final int NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID
        enum nvrtcResult
        See Also:
        Constant Field Values
      • NVRTC_ERROR_INTERNAL_ERROR

        public static final int NVRTC_ERROR_INTERNAL_ERROR
        enum nvrtcResult
        See Also:
        Constant Field Values
    • Constructor Detail

      • nvrtc

        public nvrtc()
    • Method Detail

      • nvrtcGetErrorString

        @Cast("const char*")
        public static BytePointer nvrtcGetErrorString​(@Cast("nvrtcResult")
                                                      int result)
        \ingroup error \brief nvrtcGetErrorString is a helper function that returns a string describing the given nvrtcResult code, e.g., NVRTC_SUCCESS to \c "NVRTC_SUCCESS". For unrecognized enumeration values, it returns \c "NVRTC_ERROR unknown".
        Parameters:
        result - [in] CUDA Runtime Compilation API result code.
        Returns:
        Message string for the given #nvrtcResult code.
      • nvrtcVersion

        @Cast("nvrtcResult")
        public static int nvrtcVersion​(IntPointer major,
                                       IntPointer minor)
        \ingroup query \brief nvrtcVersion sets the output parameters \p major and \p minor with the CUDA Runtime Compilation version number.
        Parameters:
        major - [out] CUDA Runtime Compilation major version number.
        minor - [out] CUDA Runtime Compilation minor version number.
        Returns:
        - \link #nvrtcResult NVRTC_SUCCESS \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
      • nvrtcVersion

        @Cast("nvrtcResult")
        public static int nvrtcVersion​(int[] major,
                                       int[] minor)
      • nvrtcCreateProgram

        @Cast("nvrtcResult")
        public static int nvrtcCreateProgram​(@ByPtrPtr
                                             _nvrtcProgram prog,
                                             @Cast("const char*")
                                             BytePointer src,
                                             @Cast("const char*")
                                             BytePointer name,
                                             int numHeaders,
                                             @Cast("const char*const*")
                                             PointerPointer headers,
                                             @Cast("const char*const*")
                                             PointerPointer includeNames)
        \ingroup compilation \brief nvrtcCreateProgram creates an instance of nvrtcProgram with the given input parameters, and sets the output parameter \p prog with it.
        Parameters:
        prog - [out] CUDA Runtime Compilation program.
        src - [in] CUDA program source.
        name - [in] CUDA program name.\n \p name can be \c NULL; \c "default_program" is used when \p name is \c NULL.
        numHeaders - [in] Number of headers used.\n \p numHeaders must be greater than or equal to 0.
        headers - [in] Sources of the headers.\n \p headers can be \c NULL when \p numHeaders is 0.
        includeNames - [in] Name of each header by which they can be included in the CUDA program source.\n \p includeNames can be \c NULL when \p numHeaders is 0.
        Returns:
        - \link #nvrtcResult NVRTC_SUCCESS \endlink - \link #nvrtcResult NVRTC_ERROR_OUT_OF_MEMORY \endlink - \link #nvrtcResult NVRTC_ERROR_PROGRAM_CREATION_FAILURE \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
      • nvrtcDestroyProgram

        @Cast("nvrtcResult")
        public static int nvrtcDestroyProgram​(@ByPtrPtr
                                              _nvrtcProgram prog)
        \ingroup compilation \brief nvrtcDestroyProgram destroys the given program.
        Parameters:
        prog - [in] CUDA Runtime Compilation program.
        Returns:
        - \link #nvrtcResult NVRTC_SUCCESS \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
      • nvrtcDestroyProgram

        @Cast("nvrtcResult")
        public static int nvrtcDestroyProgram​(@Cast("_nvrtcProgram**")
                                              PointerPointer prog)
      • nvrtcCompileProgram

        @Cast("nvrtcResult")
        public static int nvrtcCompileProgram​(_nvrtcProgram prog,
                                              int numOptions,
                                              @Cast("const char*const*")
                                              PointerPointer options)
        \ingroup compilation \brief nvrtcCompileProgram compiles the given program. It supports compile options listed in \ref options.
      • nvrtcCompileProgram

        @Cast("nvrtcResult")
        public static int nvrtcCompileProgram​(_nvrtcProgram prog,
                                              int numOptions,
                                              @Cast("const char*const*") @ByPtrPtr
                                              byte[] options)
      • nvrtcGetPTXSize

        @Cast("nvrtcResult")
        public static int nvrtcGetPTXSize​(_nvrtcProgram prog,
                                          @Cast("size_t*")
                                          SizeTPointer ptxSizeRet)
        \ingroup compilation \brief nvrtcGetPTXSize sets \p ptxSizeRet with the size of the PTX generated by the previous compilation of \p prog (including the trailing \c NULL).
        Parameters:
        prog - [in] CUDA Runtime Compilation program.
        ptxSizeRet - [out] Size of the generated PTX (including the trailing \c NULL).
        Returns:
        - \link #nvrtcResult NVRTC_SUCCESS \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
      • nvrtcGetPTX

        @Cast("nvrtcResult")
        public static int nvrtcGetPTX​(_nvrtcProgram prog,
                                      @Cast("char*")
                                      BytePointer ptx)
        \ingroup compilation \brief nvrtcGetPTX stores the PTX generated by the previous compilation of \p prog in the memory pointed by \p ptx.
        Parameters:
        prog - [in] CUDA Runtime Compilation program.
        ptx - [out] Compiled result.
        Returns:
        - \link #nvrtcResult NVRTC_SUCCESS \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
      • nvrtcGetPTX

        @Cast("nvrtcResult")
        public static int nvrtcGetPTX​(_nvrtcProgram prog,
                                      @Cast("char*")
                                      byte[] ptx)
      • nvrtcGetProgramLogSize

        @Cast("nvrtcResult")
        public static int nvrtcGetProgramLogSize​(_nvrtcProgram prog,
                                                 @Cast("size_t*")
                                                 SizeTPointer logSizeRet)
        \ingroup compilation \brief nvrtcGetProgramLogSize sets \p logSizeRet with the size of the log generated by the previous compilation of \p prog (including the trailing \c NULL). Note that compilation log may be generated with warnings and informative messages, even when the compilation of \p prog succeeds.
        Parameters:
        prog - [in] CUDA Runtime Compilation program.
        logSizeRet - [out] Size of the compilation log (including the trailing \c NULL).
        Returns:
        - \link #nvrtcResult NVRTC_SUCCESS \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
      • nvrtcGetProgramLog

        @Cast("nvrtcResult")
        public static int nvrtcGetProgramLog​(_nvrtcProgram prog,
                                             @Cast("char*")
                                             BytePointer log)
        \ingroup compilation \brief nvrtcGetProgramLog stores the log generated by the previous compilation of \p prog in the memory pointed by \p log.
        Parameters:
        prog - [in] CUDA Runtime Compilation program.
        log - [out] Compilation log.
        Returns:
        - \link #nvrtcResult NVRTC_SUCCESS \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
      • nvrtcGetProgramLog

        @Cast("nvrtcResult")
        public static int nvrtcGetProgramLog​(_nvrtcProgram prog,
                                             @Cast("char*")
                                             byte[] log)
      • nvrtcAddNameExpression

        @Cast("nvrtcResult")
        public static int nvrtcAddNameExpression​(_nvrtcProgram prog,
                                                 @Cast("const char*")
                                                 BytePointer name_expression)
        \ingroup compilation \brief nvrtcAddNameExpression notes the given name expression denoting the address of a __global__ function or __device__/__constant__ variable. The identical name expression string must be provided on a subsequent call to nvrtcGetLoweredName to extract the lowered name.
        Parameters:
        prog - [in] CUDA Runtime Compilation program.
        name_expression - [in] constant expression denoting the address of a __global__ function or __device__/__constant__ variable.
        Returns:
        - \link #nvrtcResult NVRTC_SUCCESS \endlink - \link #nvrtcResult NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION \endlink
      • nvrtcAddNameExpression

        @Cast("nvrtcResult")
        public static int nvrtcAddNameExpression​(_nvrtcProgram prog,
                                                 String name_expression)
      • nvrtcGetLoweredName

        @Cast("nvrtcResult")
        public static int nvrtcGetLoweredName​(_nvrtcProgram prog,
                                              @Cast("const char*")
                                              BytePointer name_expression,
                                              @Cast("const char**")
                                              PointerPointer lowered_name)
        \ingroup compilation \brief nvrtcGetLoweredName extracts the lowered (mangled) name for a __global__ function or __device__/__constant__ variable, 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.
        Parameters:
        prog - [in] CUDA Runtime Compilation program.
        name_expression - [in] constant expression denoting the address of a __global__ function or __device__/__constant__ variable.
        lowered_name - [out] initialized by the function to point to a C string containing the lowered (mangled) name corresponding to the provided name expression.
        Returns:
        - \link #nvrtcResult NVRTC_SUCCESS \endlink - \link #nvrtcResult NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION \endlink - \link #nvrtcResult NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID \endlink