dpctl.tensor.Device
- class dpctl.tensor.Device(*args, **kwargs)[source]
An object representing Data-API concept of device.
This is a wrapper around
dpctl.SyclQueuewith custom formatting. The class does not have public constructor, but a class methoddpctl.tensor.Device.create_device()to construct it from device keyword argument in Array-API functions.Instance can be queried for
sycl_queue,sycl_context, orsycl_device.Attributes:
dpctl.SyclContextassociated with thisDevice.dpctl.SyclDevicetargeted by thisDevice.dpctl.SyclQueueused to offload to thisDevice.sycl_queue_Public methods:
create_device([device])Creates instance of Device from argument.
print_device_info()Outputs information about targeted SYCL device
wait()Call
waitmethod of the underlyingsycl_queue.
Attributes
- Device.sycl_context
dpctl.SyclContextassociated with thisDevice.
- Device.sycl_device
dpctl.SyclDevicetargeted by thisDevice.
- Device.sycl_queue
dpctl.SyclQueueused to offload to thisDevice.
Public methods
- dpctl.tensor.Device.create_device(device=None)
Creates instance of Device from argument.
- Parameters:
device – Device specification, i.e. None,
Device,dpctl.SyclQueue, or adpctl.SyclDevicecorresponding to a root SYCL device.- Raises:
ValueError – if an instance of
dpctl.SycDevicecorresponding to a sub-device was specified as the argumentSyclQueueCreationError – if
dpctl.SyclQueuecould not be created from the argument