You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dpctl.get_devices does not return devices in the same order as sycl::device::get_devices #447
In [25]: d0=dpctl.SyclDevice("gpu:0")
In [26]: d0.filter_stringOut[26]: 'opencl:gpu:0'In [27]: [ifori, diinenumerate(dpctl.get_devices(dpctl.backend_type.all, dpctl.device_type.gpu)) ifdi==d0]
Out[27]: [1]
In [28]: d0==dpctl.SyclDevice(d0.filter_string)
Out[28]: TrueIn [29]: d1=dpctl.SyclDevice("gpu:1")
In [30]: d1.filter_stringOut[30]: 'level_zero:gpu:0'In [31]: [ifori, diinenumerate(dpctl.get_devices(dpctl.backend_type.all, dpctl.device_type.gpu)) ifdi==d1]
Out[31]: [0]
In [32]: d1==dpctl.SyclDevice(d1.filter_string)
Out[32]: True
At the same type, the C++ code does:
#include<CL/sycl.hpp>
#include<iostream>intmain(void) {
sycl::ONEAPI::filter_selector fs0{"gpu:0"};
sycl::device d0(fs0);
std::cout << "Device0's driver version " << d0.get_info<sycl::info::device::driver_version>() <<std::endl;
sycl::ONEAPI::filter_selector fs1{"gpu:1"};
sycl::device d1(fs1);
std::cout << "Device1's driver version " << d1.get_info<sycl::info::device::driver_version>() <<std::endl;
std::vector<sycl::device> v = sycl::device::get_devices(sycl::info::device_type::gpu);
for(size_t i=0; i < v.size(); ++i) {
if (v[i] == d0) {
std::cout << "Index for device0 is " << i <<std::endl;
}
if (v[i] == d1) {
std::cout << "Index for device1 is " << i <<std::endl;
}
}
return0;
}
(idp) [08:32:27 nuc wd]$ dpcpp example.cpp && ./a.out
Device0's driver version 21.11.19310
Device1's driver version 1.0.19310
Index for device0 is 0
Index for device1 is 1
Activity
Fixes #447
Added tests for #447
Fixes #447
Added tests for #447
Fixes #447
Added tests for #447