warp.CaptureMode#
- class warp.CaptureMode(*values)[source]#
CUDA stream capture mode; mirrors
cudaStreamCaptureMode.Controls how strictly CUDA rejects capture-unsafe runtime APIs while a capture is active.
RELAXEDis typically required when composing with libraries that perform lazy / capture-unsafe runtime calls (e.g. context initialization) during the capture.The default mode used by
capture_begin()andScopedCaptureisTHREAD_LOCAL, which preserves the historical Warp behavior.Attributes
Capture-unsafe runtime APIs called from any thread invalidate the capture.
Capture-unsafe runtime APIs called from the capturing thread invalidate the capture, but other threads are unaffected.
Capture-unsafe runtime APIs are tolerated and do not invalidate the capture.
- GLOBAL = 0#
Capture-unsafe runtime APIs called from any thread invalidate the capture. This is the strictest mode and matches
cudaStreamCaptureModeGlobal.
- THREAD_LOCAL = 1#
Capture-unsafe runtime APIs called from the capturing thread invalidate the capture, but other threads are unaffected. Matches
cudaStreamCaptureModeThreadLocal. This is the default Warp uses.
- RELAXED = 2#
Capture-unsafe runtime APIs are tolerated and do not invalidate the capture. Matches
cudaStreamCaptureModeRelaxed. Useful when composing with libraries that still perform lazy / capture-unsafe CUDA runtime calls (e.g.cudaFree(0)during lazy context / allocator init) during the capture.