warp.compile_aot_module#
- warp.compile_aot_module(
- module,
- device=None,
- arch=None,
- module_dir=None,
- use_ptx=None,
- strip_hash=None,
Compile a module (ahead of time) for a given device.
- Parameters:
module (Module | ModuleType | str) – The module to compile.
device (Device | str | list[Device] | list[str] | None) – The device or devices to compile the module for. If
None, andarchis not specified, compile the module for the current device.arch (int | Iterable[int] | None) – The architecture or architectures to compile the module for. If
None, the architecture to compile for will be inferred from the current device.module_dir (str | PathLike | None) – The directory to save the source, meta, and compiled files to. If not specified, the module will be compiled to the default cache directory.
use_ptx (bool | None) – Whether to compile the module to PTX. This setting is only used when compiling modules for the GPU. If
None, Warp will decide an appropriate setting based on the runtime environment.strip_hash (bool | None) –
Whether to strip the hash from the module and kernel names. Setting this value to
TrueorFalsewill update the module’s"strip_hash"option. If left atNone, the current value will be used.Warning: Do not enable
strip_hashfor modules that contain generic kernels. Generic kernels compile to multiple overloads, and the per-overload hash is required to distinguish them. Stripping the hash in this case will cause the module to fail to compile.
- Raises:
TypeError – If the module argument is not a Module, a types.ModuleType, or a string.
- Return type:
None