Test plan for compile-time property_list
This is a test plan for the APIs described in SYCL_EXT_ONEAPI_property_list.asciidoc
1. Testing scope
1.1. Device coverage
All of the tests described below are performed only on the default device that is selected on the CTS command line.
1.2. Feature test macro
All of the tests should use #ifdef SYCL_EXT_ONEAPI_PROPERTY_LIST
so they can be skipped
if feature is not supported.
2. Tests
Tests are using compile-time properties from extension SYCL_EXT_ONEAPI_DEVICE_GLOBAL,
because of it test should be skipped if SYCL_EXT_ONEAPI_DEVICE_GLOBAL
is not defined.
2.1. Tests for property_value
Get prop_values from prop_lists:
property_list props1{device_image_scope_v};
auto prop_value1 = props.get_property<device_image_scope>();
property_list props2{host_access_v<A>};
where A = host_access::access::read, host_access::access::write, host_access::access::read_write, host_access::access::none
auto prop_value_A = props.get_property<host_access>();
Check that for prop_value1
members value
and value_t
are not available.
Check that for every A
prop_value_A
member value
is A
and member value_t
is host_access::access
.
2.2. Tests for equality and inequality operators for properties
Get prop_values from prop_lists:
property_list props1{device_image_scope_v};
auto prop_value_device_image_scope = props.get_property<device_image_scope>();
property_list props2{implement_in_csr_v<true>};
auto prop_value_implement_in_csr_true = props.get_property<implement_in_csr_v>();
property_list props3{implement_in_csr_v<false>};
auto prop_value_implement_in_csr_false = props.get_property<implement_in_csr_v>();
Check constexpr correctness if required and result for operators:
operator | first parameter | second parameter | result |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2.3. Tests for property_list
2.3.1. has_property
Create property_list with property_list P1{device_image_scope_v, implement_in_csr_v<true>, host_access_v<access:read>}
and check P1.has_property<T> returns:
-
true
forT = device_image_scope
-
true
forT = implement_in_csr
-
true
forT = host_access
-
false
forT = init_mode
2.4. Tests for is_property_list
-
Create property_list with
property_list props{device_image_scope_v, implement_in_csr_v<true>}
-
Check that
is_property_list<decltype(props)>
isstd::true_type
-
Check that
is_property_list_v<decltype(props)>
istrue
-
Create custom class A
-
Check that
is_property_list<A>
isstd::false_type
-
Check that
is_property_list_v<A>
isfalse
2.5. Different order
-
Call property_list constructor
property_list P1{implement_in_csr_v<true>, device_image_scope_v}
-
Call property_list constructor
property_list P2{device_image_scope_v, implement_in_csr_v<true>}
-
Check that
std::is_same_v<decltype(P1), decltype(P2)>
istrue
.
2.6. is_property
-
Check that
is_property<device_image_scope>
isstd::true_type
-
Check that
is_property<host_access>
isstd::true_type
-
Check that
is_property<init_mode>
isstd::true_type
-
Check that
is_property<device_image_scope>
isstd::true_type
2.7. is_device_copyable
2.7.1. is_device_copyable for compile-time-constant properties
-
Check that
is_device_copyable<device_image_scope::value_t>
isstd::true_type
-
Check that
is_device_copyable<host_access::value_t<access::read>>
isstd::true_type
-
Check that
is_device_copyable<host_access::value_t<access::write>>
isstd::true_type
-
Check that
is_device_copyable<host_access::value_t<access::read_write>>
isstd::true_type
-
Check that
is_device_copyable<host_access::value_t<access::none>>
isstd::true_type
-
Check that
is_device_copyable<init_mode::value_t<trigger::reprogram>>
isstd::true_type
-
Check that
is_device_copyable<init_mode::value_t<trigger::reset>>
isstd::true_type
-
Check that
is_device_copyable<implement_in_csr::value_t<true>>
isstd::true_type
-
Check that
is_device_copyable<implement_in_csr::value_t<false>>
isstd::true_type
2.7.2. is_device_copyable for empty property_list
-
Create empty propery_list
property_list P1{}
-
Check that
is_device_copyable<decltype(P1)>
isstd::true_type
2.7.3. is_device_copyable for property_list with only compile-time-constant properties
-
Create property_list
property_list P2{implement_in_csr_v<true>, device_image_scope_v}
-
Check that
is_device_copyable<decltype(P2)>
isstd::true_type