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.Methods
conjugateReturns self, the complex conjugate of any int.
bit_length()Number of bits necessary to represent self in binary.
bit_count()Number of ones in the binary representation of the absolute value of self.
to_bytes([length, byteorder, signed])Return an array of bytes representing an integer.
from_bytes(bytes[, byteorder, signed])as_integer_ratio()Return a pair of integers, whose ratio is equal to the original int.
is_integer()Returns True.
__init__(*args, **kwds)Attributes
realthe real part of a complex number
imagthe imaginary part of a complex number
numeratorthe numerator of a rational number in lowest terms
denominatorthe denominator of a rational number in lowest terms
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.