tvm_ffi.use_raw_stream#
- tvm_ffi.use_raw_stream(device, stream)[source]#
Create an FFI stream context with the given device and stream handle.
- Parameters:
- Return type:
- Returns:
context – The FFI stream context.
Examples
The example below uses a CPU device and a dummy stream handle. On CUDA, pass a real
cudaStream_tinteger.import tvm_ffi dev = tvm_ffi.device("cpu:0") with tvm_ffi.use_raw_stream(dev, 0): # Within the context, the current stream for this device is set assert tvm_ffi.get_raw_stream(dev) == 0
See also
tvm_ffi.use_torch_stream()Use a Torch stream or CUDA graph as the source of truth.
tvm_ffi.get_raw_stream()Query the current FFI stream for a device.