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. RELAXED is 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() and ScopedCapture is THREAD_LOCAL, which preserves the historical Warp behavior.

__init__(*args, **kwds)[source]#

Methods

conjugate

Returns 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

real

the real part of a complex number

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

denominator

the denominator of a rational number in lowest terms

GLOBAL

Capture-unsafe runtime APIs called from any thread invalidate the capture.

THREAD_LOCAL

Capture-unsafe runtime APIs called from the capturing thread invalidate the capture, but other threads are unaffected.

RELAXED

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.