cuda.bindings._v2.driver.library_load_data#
- cuda.bindings._v2.driver.library_load_data(
- code,
- intptr_t jit_options,
- intptr_t jit_options_values,
- unsigned int num_jit_options,
- intptr_t library_options,
- intptr_t library_option_values,
- unsigned int num_library_options,
Load a library with specified code and options.
Takes a pointer
codeand loads the corresponding librarylibrarybased 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 withlibrary_unload().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
codemay be acubinorfatbinas output by nvcc, or a NULL- terminatedPTX, either as output by nvcc or hand-written, orTileIR data. A fatbin should also contain relocatable code when doing separate compilation. Options are passed as an array viajit_optionsand any corresponding parameters are passed injit_optionsValues. The number of total JIT options is supplied vianum_jit_options. Any outputs will be returned viajit_optionsValues. Library load options are passed as an array vialibrary_optionsand any corresponding parameters are passed inlibrary_option_values. The number of total library load options is supplied vianum_library_options.- Parameters:
code (bytes) – Code to load.
jit_options (intptr_t) – Options for JIT.
jit_options_values (intptr_t) – Option values for JIT.
num_jit_options (unsigned int) – Number of options.
library_options (intptr_t) – Options for loading.
library_option_values (intptr_t) – Option values for loading.
num_library_options (unsigned int) – Number of options for loading.
- Returns:
Returned library.
- Return type:
intptr_t
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.See also
cuLibraryLoadData