cuda.bindings._v2.driver.thread_exchange_stream_capture_mode#

cuda.bindings._v2.driver.thread_exchange_stream_capture_mode(int mode) → int#

Swap the stream capture interaction mode of the calling thread.

Sets the calling thread’s stream capture interaction mode to mode and returns the mode it had before. Callers are encouraged to use this in a push-pop fashion: set the mode they need, and restore the returned one afterwards.

During stream capture, some actions (such as a call to cudaMalloc) may be unsafe. A thread’s mode is one of the StreamCaptureMode values: GLOBAL (the default), THREAD_LOCAL or RELAXED.

Parameters:

mode (int) – The new mode, a StreamCaptureMode value.

Returns:

The previous mode of the thread, a StreamCaptureMode value.

Return type:

int

See also

cuThreadExchangeStreamCaptureMode