Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 1.97 KB

any_device_has_all_devices_have.asciidoc

File metadata and controls

47 lines (37 loc) · 1.97 KB

Test plan for traits any_device_has and all_devices_have

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.

1. Testing scope

1.1. Aspect coverage

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

2. Tests

  • 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) is true. Since kernel K is empty, it should be compatible with any device that is supported by the compilation environment.

    • For each aspect A check if D.has_aspect(A) is true.

    • If (is_compatible<K>(D) && D.has(A)) is true, then any_device_has_v<A> must be true and any_device_has<A> must inherit from std::true_type.

    • If any_device_has_v<A> is false then (is_compatible<K>(D) && D.has(A)) must be false.

    • If (is_compatible<K>(D) && !D.has(A)) is true, then all_devices_have_v<A> must be false and all_devices_have<A> must inherit from std::false_type.

    • If all_devices_have_v<A> is true then (D.has(A) || !is_compatible<K>(D)) must be true.