Function cuLibraryLoadData

Source
pub unsafe extern "C" fn cuLibraryLoadData(
    library: *mut CUlibrary,
    code: *const c_void,
    jitOptions: *mut CUjit_option,
    jitOptionsValues: *mut *mut c_void,
    numJitOptions: c_uint,
    libraryOptions: *mut CUlibraryOption,
    libraryOptionValues: *mut *mut c_void,
    numLibraryOptions: c_uint,
) -> CUresult
Expand description

\brief Load a library with specified code and options

Takes a pointer \p code and loads the corresponding library \p library based on the application defined library loading mode:

  • If module loading is set to EAGER, via the environment variables described in “Module loading”, \p library is loaded eagerly into all contexts at the time of the call and future contexts at the time of creation until the library is unloaded with ::cuLibraryUnload().
  • If the environment variables are set to LAZY, \p library is not immediately loaded onto all existent contexts and will only be loaded when a function is needed for that context, such as a kernel launch.

These environment variables are described in the CUDA programming guide under the “CUDA environment variables” section.

The \p code may be a \e cubin or \e fatbin as output by \b nvcc, or a NULL-terminated \e PTX, either as output by \b nvcc or hand-written. A fatbin should also contain relocatable code when doing separate compilation.

Options are passed as an array via \p jitOptions and any corresponding parameters are passed in \p jitOptionsValues. The number of total JIT options is supplied via \p numJitOptions. Any outputs will be returned via \p jitOptionsValues.

Library load options are passed as an array via \p libraryOptions and any corresponding parameters are passed in \p libraryOptionValues. The number of total library load options is supplied via \p numLibraryOptions.

\note If the library contains managed variables and no device in the system supports managed variables this call is expected to return ::CUDA_ERROR_NOT_SUPPORTED

\param library - Returned library \param code - Code to load \param jitOptions - Options for JIT \param jitOptionsValues - Option values for JIT \param numJitOptions - Number of options \param libraryOptions - Options for loading \param libraryOptionValues - Option values for loading \param numLibraryOptions - Number of options for loading

\return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_PTX, ::CUDA_ERROR_UNSUPPORTED_PTX_VERSION, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NO_BINARY_FOR_GPU, ::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, ::CUDA_ERROR_JIT_COMPILER_NOT_FOUND, ::CUDA_ERROR_NOT_SUPPORTED

\sa ::cuLibraryLoadFromFile, ::cuLibraryUnload, ::cuModuleLoad, ::cuModuleLoadData, ::cuModuleLoadDataEx