warp.Module#

class warp.Module(name, loader=None)[source]#
Parameters:

name (str | None)

__init__(name, loader=None)[source]#
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()

Get an abbreviated module name to use for directories and files in the cache.

hash_module()

Get the hash of the module for the current block_dim.

increment_id()

load(device[, block_dim, binary_path, ...])

mark_modified()

register_function(func, scope_locals[, ...])

register_kernel(kernel)

register_struct(struct)

unload()

increment_id()[source]#
Return type:

int

register_struct(struct)[source]#
register_kernel(kernel)[source]#
register_function(
func,
scope_locals,
skip_adding_overload=False,
)[source]#
hash_module()[source]#

Get the hash of the module for the current block_dim.

This function always creates a new ModuleHasher instance and computes the hash.

Return type:

bytes

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.

Parameters:

block_dim (int | None)

Return type:

bytes

get_module_identifier()[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.

Return type:

str

load(
device,
block_dim=None,
binary_path=None,
output_arch=None,
meta_path=None,
)[source]#
Parameters:
Return type:

ModuleExec | None

unload()[source]#
mark_modified()[source]#
get_kernel_hooks(kernel, device)[source]#
Parameters:

device (Device)

Return type:

KernelHooks