tvm_ffi.StreamContext

tvm_ffi.StreamContext#

class tvm_ffi.StreamContext(device, stream)[source]#

Bases: object

Represent a stream context in the FFI system.

StreamContext helps setup ffi environment stream by python with statement. When entering with scope, it caches the current environment stream and setup the given new stream. When exiting with scope, it recovers the stream to the cached environment stream.

Parameters:
  • device (Device) – The device to which the stream belongs.

  • stream (Union[int, c_void_p]) – The stream handle.

__init__(device, stream)[source]#

Initialize a stream context with a device and stream handle.

Parameters:
Return type:

None

Methods

__init__(device, stream)

Initialize a stream context with a device and stream handle.