warp.capture_load#

warp.capture_load(path, device=None)[source]#

Load a serialized graph from a .wrp file.

For graphs containing recorded kernels, the companion <stem>_modules/ directory created by capture_save() must remain next to the file. device must have the same device family (CPU or CUDA) as the saved graph. CUDA loading prefers a compatible packaged or cached module, then compiles retained generated source for the selected device. To load a graph whose files are already in memory, use capture_load_from_bytes().

Parameters:
  • path (str) – Path to the .wrp file (extension added automatically if missing).

  • device (Device | str | None) – The device to load the graph onto (CPU or CUDA).

Returns:

A Graph object that can be launched with capture_launch().

Return type:

Graph