warp.Module#
- class warp.Module(name, loader=None)[source]#
Warp module containing kernels and functions to be compiled.
- Parameters:
name (str | None)
Methods
__init__(name[, loader])get_kernel_hooks(kernel, device)get_module_hash([block_dim])Get the hash of the module for the current block_dim.
get_module_identifier([block_dim])Get an abbreviated module name to use for directories and files in the cache.
Get the hash of the module for the current block_dim.
load(device[, block_dim, binary_path, ...])register_function(func, scope_locals[, ...])register_kernel(kernel)register_struct(struct)resolve_options(config)Return a fully-resolved copy of the module options.
unload()- resolve_options(config)[source]#
Return a fully-resolved copy of the module options.
Resolves
Nonesentinels by falling back toconfigvalues and hardcoded defaults. Also includes global config flags that affect compilation, so downstream consumers never need to read config directly.- Return type:
- hash_module()[source]#
Get the hash of the module for the current block_dim.
This function always creates a new
ModuleHasherand computes the hash.- Return type:
- get_module_hash(block_dim=None)[source]#
Get the hash of the module for the current block_dim.
If a hash has not been computed for the current block_dim, it will be computed and cached.
- get_module_identifier(block_dim=None)[source]#
Get an abbreviated module name to use for directories and files in the cache.
Depending on the setting of the
"strip_hash"option for this module, the module identifier might include a content-dependent hash as a suffix.