dpctl.SyclDevice¶
- class dpctl.SyclDevice(arg=None)¶
A Python wrapper for the
sycl::deviceC++ class.There are two ways of creating a SyclDevice instance:
by directly passing in a filter string to the class constructor. The filter string needs to conform to the DPC++ filter selector SYCL extension.
- Example:
import dpctl # Create a SyclDevice with an explicit filter string, # in this case the first level_zero gpu device. level_zero_gpu = dpctl.SyclDevice("level_zero:gpu:0") level_zero_gpu.print_device_info()
by calling one of the device selector helper functions:
dpctl.select_accelerator_device(),dpctl.select_cpu_device(),dpctl.select_default_device(),dpctl.select_gpu_device()
- Example:
import dpctl # Create a SyclDevice of type GPU based on whatever is returned # by the SYCL `gpu_selector` device selector class. gpu = dpctl.select_gpu_device() gpu.print_device_info()
- Parameters:
arg (str, optional) – The argument can be a selector string, another
dpctl.SyclDevice, orNone. Defaults toNone.- Raises:
MemoryError – If the constructor could not allocate necessary temporary memory.
SyclDeviceCreationError – If the
dpctl.SyclDeviceobject creation failed.TypeError – If the argument is not a
dpctl.SyclDeviceor string.
Methods
Returns the address of the
DPCTLSyclDeviceRefpointer as asize_t.can_access_peer(peer[, value])Returns
Trueif this device (self) can enable peer access to USM device memory onpeer,Falseotherwise.can_compile(language)Check whether it is possible to create an executable kernel_bundle for this device from the given source language.
Returns a tuple of component devices contained in this SYCL device.
create_sub_devices([partition])Creates a tuple of sub-devices by partitioning a root device based on the provided partition specifier.
disable_peer_access(peer)Disables peer access to
peerfrom this device (self).enable_peer_access(peer)Enables this device (
self) to access USM device allocations located onpeer.For an unpartitioned device, returns the canonical index of this device in the list of devices visible to dpctl.
get_filter_string([include_backend, ...])For a parent device, returns a filter selector string that includes backend or device type based on the value of the given keyword arguments.
Returns the unpartitioned parent device of this device.
Print information about the SYCL device.
Attributes
Returns the address space size of the device.
Returns a tuple of
dpctl.memory_orderenum members describing atomic fence order capabilities of the device.Returns a tuple of
dpctl.memory_scopeenum members describing atomic fence scope capabilities of the device.Returns a tuple of
dpctl.memory_orderenum members describing atomic memory order capabilities of the device.Returns a tuple of
dpctl.memory_scopeenum members describing atomic memory scope capabilities of the device.Returns the
backend_typeenum value for this deviceReturns a backend version string.
The composite device for a component device, or
Nonefor a non-component device.Integral score assigned to this device by DPC++ runtime's default selector's scoring function.
Returns the type of the device as a
device_typeenum.Returns a tuple of
dpctl.fp_configenum members describing double-precision floating-point capabilities of the device.Returns a backend-defined driver version as a string.
Returns
Trueif the device implements error correction for all accesses to compute device memories (global, local, etc.).For a root device, returns a fully specified filter selector string
"backend:device_type:relative_id"selecting the device.Global device memory cache line size.
Global device memory cache size.
Global device cache memory type.
Returns the size of global memory on this device in bytes.
Returns a tuple of
dpctl.fp_configenum members describing half-precision floating-point capabilities of the device.Returns
Trueif this device is an accelerator device,Falseotherwise.Returns
Trueif the device supports a basic set of atomic operations,Falseotherwise.Returns
Trueif this device is a CPU device,Falseotherwise.Returns
Trueif this device is a custom device,Falseotherwise.Returns
Trueif this device is somehow emulated,Falseotherwise.Returns
Trueif this device supports inter-process communication (IPC) memory handles,Falseotherwise.Returns
Trueif the device supports half-precision floating point operations,Falseotherwise.Returns
Trueif the device supports 64-bit precision floating point operations,Falseotherwise.Returns
Trueif this device is a GPU device,Falseotherwise.Returns
Trueif kernels running on this device can be debugged using standard debuggers that are normally available on the host system,Falseotherwise.Returns
Trueif the device supports images,Falseotherwise (refer Sec 4.15.3 of SYCL 2020 spec).Returns
Trueif this device is a component device,Falseotherwise.Returns
Trueif this device is a composite device,Falseotherwise.Returns
Trueif this device supports online compilation of device code,Falseotherwise.Returns
Trueif this device supports online linking of device code,Falseotherwise.Returns
Trueif this device supports queue profiling,Falseotherwise.Returns
Trueif this device supports USM-host allocations and the host and this device may concurrently access and atomically modify host allocations,Falseotherwise.Returns
Trueif this device supports USM-shared allocations and the host and other devices in the same context as this device may concurrently access and atomically modify shared allocations,Falseotherwise.Returns
Trueif this device supports explicit USM allocations,Falseotherwise (refer Section 4.8 of SYCL 2020 specs).Returns
Trueif this device can access USM-host memory,Falseotherwise (refer Section 4.8 of SYCL 2020 specs).Returns
Trueif this device supports USM-shared memory allocated on the same device,Falseotherwise.Returns
Trueif system allocator may be used instead of SYCL USM allocation mechanism for USM-shared allocations on this device,Falseotherwise.Returns the maximum height of a 2D image or 1D image in pixels.
Returns the maximum width of a 2D image or 1D image in pixels.
Returns the maximum depth of a 3D image in pixels.
Returns the maximum height of a 3D image in pixels.
Returns the maximum width of a 3D image in pixels.
Returns the max number of pixels for a 1D image created from a buffer.
Returns
Trueif this instance is a SYCL accelerator device.Returns
Trueif the device is available.Returns
Trueif this instance is a SYCL CPU device.Returns
Trueif this instance is a SYCL GPU device.Returns the size of local memory on this device in bytes.
Returns the type of local memory supported by the device.
Maximal clock frequency in MHz.
Returns the number of parallel compute units available to the device.
Maximum size of memory object than can be allocated.
Returns the maximum number of sub-groups in a work-group for any kernel executed on the device.
Returns the maximum size in bytes of all arguments that can be passed to a kernel.
Returns the maximum number of simultaneous image objects that can be read from by a kernel.
Returns the maximum number of samplers that can be used in a kernel.
Returns the maximum number of work-items that are permitted in a work-group executing a kernel on a single compute unit.
Returns the maximum dimensions that specify the global and local work-item IDs used by the data parallel execution model.
Returns the maximum number of work-items that are permitted in each dimension of the work-group of the nd_range.
Returns the maximum number of work-items that are permitted in each dimension of the work-group of the
sycl::nd_range<1>.Returns the maximum number of work-items that are permitted in each dimension of the work-group of the
sycl::nd_range<2>.Returns the maximum number of work-items that are permitted in each dimension of the work-group of the
sycl::nd_range<3>.Returns the maximum number of simultaneous image objects that can be written to by a kernel.
Returns the minimum value to which memory allocations on this device are aligned in bits.
Returns the name of the device as a string
Returns the native ISA vector width size for built-in scalar types that can be put into vectors.
Returns the native ISA vector width size for built-in scalar types that can be put into vectors.
Returns the native ISA vector width size for built-in scalar types that can be put into vectors.
Returns the native ISA vector width size for built-in scalar types that can be put into vectors.
Returns the native ISA vector width size for built-in scalar types that can be put into vectors.
Returns the native ISA vector width size for built-in scalar types that can be put into vectors.
Returns the native ISA vector width size for built-in scalar types that can be put into vectors.
Parent device for a sub-device, or None for a root device.
Returns a tuple of strings describing supported partition affinity domains of the device.
The maximum number of sub-devices this
dpctl.SyclDeviceinstance can be partitioned into.Returns a tuple of
dpctl.partition_propertyenum members describing supported partition properties of the device.Returns the partition affinity domain used to partition the parent device if this is a sub-device partitioned by affinity domain, or
"not_applicable"otherwise.Returns the partition property of this device if it is a sub-device, or
partition_property.no_partitionif it is not a sub-device.Returns the preferred native vector width size for built-in scalar types that can be put into vectors.
Returns the preferred native vector width size for built-in scalar types that can be put into vectors.
Returns the preferred native vector width size for built-in scalar types that can be put into vectors.
Returns the preferred native vector width size for built-in scalar types that can be put into vectors.
Returns the preferred native vector width size for built-in scalar types that can be put into vectors.
Returns the preferred native vector width size for built-in scalar types that can be put into vectors.
Returns the preferred native vector width size for built-in scalar types that can be put into vectors.
Profiling timer resolution.
Returns a tuple of
dpctl.fp_configenum members describing single-precision floating-point capabilities of the device.Returns tuple of supported sub-group sizes for this device.
Returns the platform associated with this device.
Returns the device vendor name as a string.
Returns the vendor identifier of the device.
Returns a backend-defined device version string.