dpctl

Data Parallel Control (dpctl) is a Python abstraction layer over SYCL.

Dpctl implements a subset of SYCL’s API providing wrappers for the SYCL runtime classes described in Section 4.6 of the SYCL 2020 spec. Note that the SYCL device_selector class is not implemented, instead there are device selection helper functions that can be used to simulate the same behavior. Dpctl implements the ONEPI::filter_selector extension that is included in Intel’s DPC++ SYCL compiler.

The module also includes a global SYCL queue manager. The queue manager provides convenience functions to create a global instance of a dpctl.SyclQueue, to create a nested stack of queue objects, and to create a queue object for use only within a specific scope.

Sub-modules

dpctl.memory

Data Parallel Control Memory provides Python objects for untyped USM memory container of bytes for each kind of USM pointers: shared pointers, device pointers and host pointers.

dpctl.program

Data Parallel Control Program provides a way to create a SYCL kernel from either an OpenCL program represented as a string or a SPIR-V binary file.

dpctl.tensor

Data Parallel Tensor Collection is a collection of tensor implementations that implement Python data API (https://data-apis.github.io/array-api/latest/) standard.

dpctl.utils

A collection of utility functions.

Classes

SyclContext

A Python wrapper for the sycl::context C++ class.

SyclDevice

A Python wrapper for the sycl::device C++ class.

SyclEvent

Python class representing sycl::event. There are multiple ways to create a dpctl.SyclEvent object: - Invoking the constructor with no arguments creates a ready event using the default constructor of the sycl::event.

SyclPlatform

Python class representing sycl::platform class.

SyclQueue

Python class representing sycl::queue. There are multiple ways to create a dpctl.SyclQueue object: - Invoking the constructor with no arguments creates a context using the default selector.

SyclTimer

Python class to measure device time of execution of commands submitted to dpctl.SyclQueue as well as the wall-time.

Queue Management Functions

device_context()

Yields a SYCL queue corresponding to the input queue object, device object, or device filter selector string.

Device Selection Functions

select_device_with_aspects()

Selects the root dpctl.SyclDevice that has the highest default selector score among devices that have all aspects in the required_aspects list, and do not have any aspects in excluded_aspects list.

Other Functions

get_include()

Return the directory that contains the dpctl *.h header files.

Enums

backend_type

An enumeration of supported SYCL backends.

device_type

An enumeration of supported SYCL device types.

event_status_type

An enumeration of SYCL event states.

global_mem_cache_type

An enumeration of global memory cache types for a device.

Exceptions

SyclContextCreationError

A SyclContextCreationError exception is raised when SyclContext could not created.

SyclDeviceCreationError

A SyclDeviceCreationError exception is raised when SyclDevice instance could not created.

SyclKernelInvalidRangeError

A SyclKernelInvalidRangeError is raised when the provided range has less than one or more than three dimensions.

SyclKernelSubmitError

A SyclKernelSubmitError exception is raised when the provided SyclKernel could not be submitted to the SyclQueue.

SyclQueueCreationError

A SyclQueueCreationError exception is raised when a SyclQueue could not be created. SyclQueue creation can fail if the filter string is invalid, or the backend or device type values are not supported.

SyclSubDeviceCreationError

A SyclSubDeviceCreationError exception is raised when sub-devices were not created.