cuda.bindings._v2.driver.library_load_from_file#
- cuda.bindings._v2.driver.library_load_from_file(
- file_name,
- jit_options,
- jit_options_values,
- library_options,
- library_option_values,
Load a library with specified file 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 file should be a
cubinfile as output by nvcc, or aPTXfile either as output by nvcc or handwritten, or afatbinfile as output by nvcc or hand-written, orTileIR file. 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 options is supplied vialen(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 vialen(library_options).- Parameters:
file_name (bytes) – File to load from.
jit_options (object) –
Options for JIT. It must be:
a Python sequence of
JitOption, orNonefor NULL.
jit_options_values (object) –
Option values for JIT. It must be:
a Python sequence of
ints (as pointer addresses), orNonefor NULL.
library_options (object) – Options for loading. It must be a Python sequence of
LibraryOption, orNone(NULL) iflibrary_option_valuesis alsoNone.library_option_values (object) –
Option values for loading. It must be:
a Python sequence of
ints (as pointer addresses), orNonefor NULL.
- 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
cuLibraryLoadFromFile