Function c10::xpu::getStreamFromExternal¶
Defined in File XPUStream.h
Function Documentation¶
-
XPUStream c10::xpu::getStreamFromExternal(sycl::queue *ext_queue, DeviceIndex device_index)¶
Get an XPUStream from an external SYCL queue.
This function allows interoperability with other libraries by enabling the use of an external SYCL queue that was not created by PyTorch. This can be useful for data exchange or other operations where integration with non-PyTorch queues is required.
NOTE: It is the user’s responsibility to ensure that the referenced SYCL queue remains alive while the corresponding XPUStream, or any c10::Stream derived from it, is in use. The different SYCL queue pointers will result in distinct XPUStream instances, even if the SYCL queues they dereference are equivalent.