This is a test plan for traits that the application can use to query aspects at compilation time that are described in SYCL 2020 4.6.4.3. Device aspects.
Tests described below are performed for following aspects:
-
sycl::aspect::cpu
-
sycl::aspect::gpu
-
sycl::aspect::accelerator
-
sycl::aspect::custom
-
sycl::aspect::emulated
-
sycl::aspect::host_debuggable
-
sycl::aspect::fp16
-
sycl::aspect::fp64
-
sycl::aspect::atomic64
-
sycl::aspect::image
-
sycl::aspect::online_compiler
-
sycl::aspect::online_linker
-
sycl::aspect::queue_profiling
-
sycl::aspect::usm_device_allocations
-
sycl::aspect::usm_host_allocations
-
sycl::aspect::usm_atomic_host_allocations
-
sycl::aspect::usm_shared_allocations
-
sycl::aspect::usm_atomic_shared_allocations
-
sycl::aspect::usm_system_allocations
-
The test defines an empty kernel K as a mechanism to determine which devices are supported by the compilation environment.
-
At runtime, iterate over all devices returned by device::get_devices. For each device
D
:-
Check if
is_compatible<K>(D)
istrue
. Since kernelK
is empty, it should be compatible with any device that is supported by the compilation environment. -
For each aspect
A
check ifD.has_aspect(A)
istrue
. -
If
(is_compatible<K>(D) && D.has(A))
istrue
, thenany_device_has_v<A>
must betrue
andany_device_has<A>
must inherit fromstd::true_type
. -
If
any_device_has_v<A>
isfalse
then(is_compatible<K>(D) && D.has(A))
must befalse
. -
If
(is_compatible<K>(D) && !D.has(A))
istrue
, thenall_devices_have_v<A>
must befalse
andall_devices_have<A>
must inherit fromstd::false_type
. -
If
all_devices_have_v<A>
istrue
then(D.has(A) || !is_compatible<K>(D))
must betrue
.
-