dpctl.tensor.Device

class dpctl.tensor.Device(*args, **kwargs)[source]

An object representing Data-API concept of device.

This is a wrapper around dpctl.SyclQueue with custom formatting. The class does not have public constructor, but a class method dpctl.tensor.Device.create_device() to construct it from device keyword argument in Array-API functions.

Instance can be queried for sycl_queue, sycl_context, or sycl_device.

Attributes:

sycl_context

dpctl.SyclContext associated with this Device.

sycl_device

dpctl.SyclDevice targeted by this Device.

sycl_queue

dpctl.SyclQueue used to offload to this Device.

sycl_queue_

Public methods:

create_device([device])

Creates instance of Device from argument.

print_device_info()

Outputs information about targeted SYCL device

wait()

Call wait method of the underlying sycl_queue.

Attributes

Device.sycl_context

dpctl.SyclContext associated with this Device.

Device.sycl_device

dpctl.SyclDevice targeted by this Device.

Device.sycl_queue

dpctl.SyclQueue used to offload to this Device.

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 a dpctl.SyclDevice corresponding to a root SYCL device.

Raises:
  • ValueError – if an instance of dpctl.SycDevice corresponding to a sub-device was specified as the argument

  • SyclQueueCreationError – if dpctl.SyclQueue could not be created from the argument