DPC++ does not support all aspects from SYCL 2020
The list of aspects that don't supported in actual way.
- emulated
- host_debuggable
- atomic64
- usm_atomic_host_allocations
- usm_atomic_shared_allocations
- usm_system_allocations
The following C++ code
#include <CL/sycl.hpp>
#include <iostream>
int main(void) {
sycl::device d {};
sycl::vector_class<sycl::aspect> asps = {
sycl::aspect::emulated,
sycl::aspect::host_debuggable,
sycl::aspect::atomic64,
sycl::aspect::usm_atomic_host_allocations,
sycl::aspect::usm_atomic_shared_allocations,
sycl::aspect::usm_system_allocations
};
int i = 0;
for (const auto &a : asps) {
if (d.has(a)) {
std::cout << "Device has aspect " << i << std::endl;
} else {
std::cout << "Device does NOT have aspect " << i << std::endl;
}
++i;
}
return 0;
}
still errors out on each of these aspects using intel/llvm DPC++ toolchain.
Still the case in oneAPI 2020.3
Some of these are now implemented in 2022.0 DPC++: https://github.com/intel/llvm/blob/bd68232bb96386bf7649345c0557ba520e73c02d/sycl/include/CL/sycl/aspects.hpp
Specifically:
atomic64
usm_atomic_host_allocations
usm_atomic_shared_allocations
usm_system_allocations
These will need to be added to dpctl.
All listed aspects are not supported by DPC++ as of version 2024.1.0 .
The updated program
``cpp
#include <CL/sycl.hpp>
#include
int main(void) { sycl::device d {}; const auto &name = d.get_infosycl::info::device::name(); const auto &dver = d.get_infosycl::info::device::driver_version();
std::cout << "Device: " << name << " [" << dver << "]" << std::endl;
std::vector<sycl::aspect> asps = {
sycl::aspect::emulated,
sycl::aspect::host_debuggable,
sycl::aspect::atomic64,
sycl::aspect::usm_atomic_host_allocations,
sycl::aspect::usm_atomic_shared_allocations,
sycl::aspect::usm_system_allocations
};
int i = 0;
for (const auto &a : asps) {
if (d.has(a)) {
std::cout << "Device has aspect " << i << std::endl;
} else {
std::cout << "Device does NOT have aspect " << i << std::endl;
}
++i;
}
return 0;
}
compiles with `icpx -fsycl asp.cpp -o asp` and outputs
(dev_dpctl) opavlyk@opavlyk-mobl:~/tmp$ ./asp Device: Intel(R) Graphics [0x9a49] [1.3.29138] Device does NOT have aspect 0 Device does NOT have aspect 1 Device has aspect 2 Device does NOT have aspect 3 Device does NOT have aspect 4 Device does NOT have aspect 5
The `dpctl.SyclDevice` only does not support querying the "emulated" aspect, to be added in 0.18 release.
Closing this issue.