dpctl.SyclPlatform

class dpctl.SyclPlatform(self, arg=None)

Python class representing sycl::platform class.

There are two ways of creating a SyclPlatform instance:

  • Invoking the constructor with no arguments creates a platform using the default selector.

Example:
import dpctl

# Create a SyclPlatform for default-selected device
pl = dpctl.SyclPlatform()
print(pl.name, pl.version)
  • Invoking the constructor with specific filter selector string that creates a queue for the device corresponding to the filter string.

Example:
import dpctl

# Create a SyclPlatform for device selected by
# filter-selector string
pl = dpctl.SyclPlatform("opencl:cpu")
print(pl.name, pl.version)

Methods

get_composite_devices()

Returns a tuple of composite dpctl.SyclDevice objects associated with dpctl.SyclPlatform instance.

get_devices([device_type])

Returns a tuple of dpctl.SyclDevice objects associated with dpctl.SyclPlatform instance selected based on the given dpctl.device_type.

print_platform_info([verbosity])

Print information about the SYCL platform.

Attributes

backend

Returns the backend_type enum value for this platform

default_context

Returns the default platform context for this platform

has_aspect_accelerator

Returns True if all devices of this platform (if any) are accelerator devices, False otherwise.

has_aspect_atomic64

Returns True if all devices of this platform (if any) support a basic set of atomic operations, False otherwise.

has_aspect_cpu

Returns True if all devices of this platform (if any) are CPU devices, False otherwise.

has_aspect_custom

Returns True if all devices of this platform (if any) are custom devices, False otherwise.

has_aspect_emulated

Returns True if all devices of this platform (if any) are somehow emulated, False otherwise.

has_aspect_ext_oneapi_ipc_memory

Returns True if all devices of this platform (if any) support inter-process communication (IPC) memory handles, False otherwise.

has_aspect_fp16

Returns True if all devices of this platform (if any) support half-precision floating point operations, False otherwise.

has_aspect_fp64

Returns True if all devices of this platform (if any) support 64-bit precision floating point operations, False otherwise.

has_aspect_gpu

Returns True if all devices of this platform (if any) are GPU devices, False otherwise.

has_aspect_host_debuggable

Returns True if kernels running on all devices of this platform (if any) can be debugged using standard debuggers that are normally available on the host system, False otherwise.

has_aspect_image

Returns True if all devices of this platform (if any) support images, False otherwise (refer Sec 4.15.3 of SYCL 2020 spec).

has_aspect_is_component

Returns True if all devices of this platform (if any) are component devices, False otherwise.

has_aspect_is_composite

Returns True if all devices of this platform (if any) are composite devices, False otherwise.

has_aspect_online_compiler

Returns True if all devices of this platform (if any) support online compilation of device code, False otherwise.

has_aspect_online_linker

Returns True if all devices of this platform (if any) support online linking of device code, False otherwise.

has_aspect_queue_profiling

Returns True if all devices of this platform (if any) support queue profiling, False otherwise.

has_aspect_usm_atomic_host_allocations

Returns True if all devices of this platform (if any) support USM memory allocated via sycl::malloc_host and can be accessed atomically, False otherwise.

has_aspect_usm_atomic_shared_allocations

Returns True if all devices of this platform (if any) support USM memory allocated via sycl::malloc_shared and can be accessed atomically, False otherwise.

has_aspect_usm_device_allocations

Returns True if all devices of this platform (if any) support explicit USM allocations, False otherwise.

has_aspect_usm_host_allocations

Returns True if all devices of this platform (if any) can access USM memory allocated via sycl::malloc_host, False otherwise.

has_aspect_usm_shared_allocations

Returns True if all devices of this platform (if any) support USM memory allocated via sycl::malloc_shared, False otherwise.

has_aspect_usm_system_allocations

Returns True if the system allocator may be used instead of SYCL USM allocation mechanisms for shared allocations on all devices of this platform (if any), False otherwise.

name

Returns the name of the platform as a string.

vendor

Returns the platform vendor name as a string.

version

Returns a backend-defined driver version as a string.