pub unsafe extern "C" fn cudaLibraryLoadFromFile(
library: *mut cudaLibrary_t,
fileName: *const c_char,
jitOptions: *mut cudaJitOption,
jitOptionsValues: *mut *mut c_void,
numJitOptions: c_uint,
libraryOptions: *mut cudaLibraryOption,
libraryOptionValues: *mut *mut c_void,
numLibraryOptions: c_uint,
) -> cudaError_tExpand description
Load a library with specified file and options.
Takes a pointer code and loads the corresponding library library based on the application defined library loading mode:
- If module loading is set to EAGER, via the environment variables described in “Module loading”,
libraryis loaded eagerly into all contexts at the time of the call and future contexts at the time of creation until the library is unloaded withcudaLibraryUnload. - If the environment variables are set to LAZY,
libraryis 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 file should be a cubin file as output by nvcc, or a PTX file either as output by nvcc or handwritten, or a fatbin file as output by nvcc or hand-written, or Tile IR file. A fatbin should also contain relocatable code when doing separate compilation. Please also see the documentation for nvrtc (https://docs.nvidia.com/cuda/nvrtc/index.html), nvjitlink (https://docs.nvidia.com/cuda/nvjitlink/index.html), and nvfatbin (https://docs.nvidia.com/cuda/nvfatbin/index.html) for more information on generating loadable code at runtime.
Options are passed as an array via jitOptions and any corresponding parameters are passed in jitOptionsValues. The number of total options is supplied via numJitOptions. Any outputs will be returned via jitOptionsValues.
Library load options are passed as an array via libraryOptions and any corresponding parameters are passed in libraryOptionValues. The number of total library load options is supplied via numLibraryOptions.
§Parameters
library: Returned library.fileName: File to load from.jitOptions: Options for JIT.jitOptionsValues: Option values for JIT.numJitOptions: Number of options.libraryOptions: Options for loading.libraryOptionValues: Option values for loading.numLibraryOptions: Number of options for loading.
§Return value
cudaError_t::CUDA_SUCCESScudaError_t::CUDA_ERROR_INVALID_VALUEcudaError_t::CUDA_ERROR_OUT_OF_MEMORYcudaError_t::CUDA_ERROR_NOT_INITIALIZEDcudaError_t::CUDA_ERROR_DEINITIALIZEDcudaError_t::CUDA_ERROR_INVALID_PTXcudaError_t::CUDA_ERROR_UNSUPPORTED_PTX_VERSIONcudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPUcudaError_t::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUNDcudaError_t::CUDA_ERROR_SHARED_OBJECT_INIT_FAILEDcudaError_t::CUDA_ERROR_JIT_COMPILER_NOT_FOUND
See also: cudaLibraryLoadData, cudaLibraryUnload, cuLibraryLoadFromFile.