From 9e5e6eaae31d47479da76b21429ad49e6b95fddb Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 27 Apr 2026 16:15:29 -0700 Subject: [PATCH] remove w/a in SyclPlatform.get_devices --- dpctl/_sycl_platform.pyx | 14 +++++++++++--- .../source/dpctl_sycl_platform_interface.cpp | 4 ---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dpctl/_sycl_platform.pyx b/dpctl/_sycl_platform.pyx index 0a0dd388b9..41eff7b5d3 100644 --- a/dpctl/_sycl_platform.pyx +++ b/dpctl/_sycl_platform.pyx @@ -415,19 +415,27 @@ cdef class SyclPlatform(_SyclPlatform): DTy = _device_type._ACCELERATOR elif dty_str == "all": DTy = _device_type._ALL_DEVICES + elif dty_str == "automatic": + DTy = _device_type._AUTOMATIC elif dty_str == "cpu": DTy = _device_type._CPU + elif dty_str == "custom": + DTy = _device_type._CUSTOM elif dty_str == "gpu": DTy = _device_type._GPU else: DTy = _device_type._UNKNOWN_DEVICE elif isinstance(device_type, device_type_t): - if device_type == device_type_t.all: - DTy = _device_type._ALL_DEVICES - elif device_type == device_type_t.accelerator: + if device_type == device_type_t.accelerator: DTy = _device_type._ACCELERATOR + elif device_type == device_type_t.all: + DTy = _device_type._ALL_DEVICES + elif device_type == device_type_t.automatic: + DTy = _device_type._AUTOMATIC elif device_type == device_type_t.cpu: DTy = _device_type._CPU + elif device_type == device_type_t.custom: + DTy = _device_type._CUSTOM elif device_type == device_type_t.gpu: DTy = _device_type._GPU else: diff --git a/libsyclinterface/source/dpctl_sycl_platform_interface.cpp b/libsyclinterface/source/dpctl_sycl_platform_interface.cpp index 4d9cf00a74..73bef73266 100644 --- a/libsyclinterface/source/dpctl_sycl_platform_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_platform_interface.cpp @@ -300,10 +300,6 @@ DPCTLPlatform_GetDevices(__dpctl_keep const DPCTLSyclPlatformRef PRef, return nullptr; } - // handle unknown device - // custom and automatic are also treated as unknown - // as DPC++ would normally treat as `all` - // see CMPLRLLVM-65826 if (DTy == DPCTLSyclDeviceType::DPCTL_UNKNOWN_DEVICE) { return wrap(DevicesVectorPtr); }