dpctl

Submodules

dpctl.memory

Unified Shared Memory operations

dpctl.program

Support for working with SYCL kernels

dpctl.tensor

Array library conforming to Python Array API specification

dpctl.utils

A collection of utility functions

Classes

SyclDevice

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

SyclContext

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

SyclQueue

Python class representing sycl::queue.

SyclEvent

Python class representing sycl::event.

SyclPlatform

Python class representing sycl::platform class.

SyclTimer

Context to time execution of tasks submitted to dpctl.SyclQueue.

Device selection

select_default_device

A wrapper for sycl::device{sycl::default_selector_v} constructor.

select_cpu_device

A wrapper for sycl::device{sycl::cpu_selector_v} constructor.

select_gpu_device

A wrapper for sycl::device{sycl::gpu_selector_v} constructor.

select_accelerator_device

A wrapper for sycl::device{sycl::accelerator_selector_v} constructor.

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.

Platform discovery

get_devices

Returns a list of dpctl.SyclDevice instances selected based on the given dpctl.device_type and dpctl.backend_type values.

lsplatform

Prints out the list of available SYCL platforms, and optionally extra metadata about each platform.

get_num_devices

A helper function to return the number of SYCL devices of a given dpctl.device_type and dpctl.backend_type.

has_gpu_devices

A helper function to check if there are any SYCL GPU devices available.

has_cpu_devices

A helper function to check if there are any SYCL CPU devices available.

has_accelerator_devices

A helper function to check if there are any SYCL Accelerator devices available.

Exceptions

SyclDeviceCreationError

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

SyclContextCreationError

A SyclContextCreationError exception is raised when SyclContext could not created.

SyclQueueCreationError

A SyclQueueCreationError exception is raised when a SyclQueue could not be created.

SyclSubDeviceCreationError

A SyclSubDeviceCreationError exception is raised by SyclDevice.create_sub_devices() when SyclDevice instance could not be partitioned into sub-devices.

Utilities

get_include()

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