Skip to content

Commit 08a0cb4

Browse files
Modified DPCTL_GetRelativeId to not count per platform
There may be more than 1 platform that has the same backend and supports the same device-type. Relative id should be counted per backend. This fixes test failures on newly added tests to verify that filter_string is device identifier for parent devices.
1 parent bb55f09 commit 08a0cb4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dpctl-capi/helper/source/dpctl_utils_helper.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,13 +433,15 @@ int64_t DPCTL_GetRelativeDeviceId(const device &Device)
433433
{
434434
auto relid = -1;
435435
auto p = Device.get_platform();
436+
auto be = p.get_backend();
436437
auto dt = Device.get_info<sycl::info::device::device_type>();
437-
auto dev_vec = p.get_devices(dt);
438+
auto dev_vec = device::get_devices(dt);
438439
int64_t id = 0;
439440
for (const auto &d_i : dev_vec) {
440441
if (Device == d_i)
441442
relid = id;
442-
++id;
443+
if (d_i.get_platform().get_backend() == be)
444+
++id;
443445
}
444446
return relid;
445447
}

0 commit comments

Comments
 (0)