Skip to content

Commit 43f33cc

Browse files
Merge pull request #737 from IntelPython/fix-get-num-devices-crash
DPCTLDeviceMgr_GetNumDevices should not operate on rejected devices
1 parent fab1c99 commit 43f33cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libsyclinterface/source/dpctl_sycl_device_manager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ size_t DPCTLDeviceMgr_GetNumDevices(int device_identifier)
286286
if (!device_identifier)
287287
return 0;
288288

289+
default_selector mRanker;
289290
for (const auto &entry : cache) {
291+
if (mRanker(entry.first) < 0)
292+
continue;
290293
auto Bty(DPCTL_SyclBackendToDPCTLBackendType(
291294
entry.first.get_platform().get_backend()));
292295
auto Dty(DPCTL_SyclDeviceTypeToDPCTLDeviceType(

0 commit comments

Comments
 (0)