Constants¶
The following constants are defined in dpctl
:
- dpctl.device_type = <enum 'device_type'>[source]¶
An
enum.Enum
of supported SYCL device types.all
accelerator
automatic
cpu
custom
gpu
- Example:
import dpctl # filter GPU devices amongst available SYCL devices gpu_devs = [ d for d in dpctl.get_devices() if ( d.device_type == dpctl.device_type.gpu ) ] # alternatively, get GPU devices directly gpu_devs2 = dpctl.get_devices(device_type=dpctl.device_type.gpu)
- dpctl.backend_type = <enum 'backend_type'>[source]¶
An
enum.Enum
of supported SYCL backends.all
cuda
hip
level_zero
opencl
- Example:
import dpctl # create a SYCL device with OpenCL backend using filter selector d = dpctl.SyclDevice("opencl") d.backend # Possible output: <backend_type.opencl: 5>