diff --git a/test/general/test_policies.pass.cpp b/test/general/test_policies.pass.cpp index de3431b5c7..b6972c535d 100644 --- a/test/general/test_policies.pass.cpp +++ b/test/general/test_policies.pass.cpp @@ -45,24 +45,31 @@ void test_policy_instance(const Policy& policy) } #endif // TEST_DPCPP_BACKEND_PRESENT +template +constexpr void assert_is_execution_policy() +{ + static_assert(oneapi::dpl::is_execution_policy::value, "wrong result for oneapi::dpl::is_execution_policy"); + static_assert(oneapi::dpl::is_execution_policy_v, "wrong result for oneapi::dpl::is_execution_policy_v"); + static_assert(oneapi::dpl::execution::is_execution_policy::value, "wrong result for oneapi::dpl::execution::is_execution_policy"); + static_assert(oneapi::dpl::execution::is_execution_policy_v, "wrong result for oneapi::dpl::execution::is_execution_policy_v"); +} + std::int32_t main() { using namespace oneapi::dpl::execution; - static_assert(is_execution_policy::value, "wrong result for is_execution_policy"); - static_assert(is_execution_policy::value, "wrong result for is_execution_policy"); - static_assert(is_execution_policy::value, "wrong result for is_execution_policy"); - static_assert(is_execution_policy::value, "wrong result for is_execution_policy"); - static_assert(is_execution_policy_v, "wrong result for is_execution_policy_v"); - static_assert(is_execution_policy_v, "wrong result for is_execution_policy_v"); - static_assert(is_execution_policy_v, "wrong result for is_execution_policy_v"); - static_assert(is_execution_policy_v, "wrong result for is_execution_policy_v"); + assert_is_execution_policy(); + assert_is_execution_policy(); + assert_is_execution_policy(); + assert_is_execution_policy(); + + // Test that the policy is not decayed + static_assert(!oneapi::dpl::is_execution_policy_v, "wrong result for is_execution_policy_v"); #if TEST_DPCPP_BACKEND_PRESENT auto q = sycl::queue{TestUtils::default_selector}; - static_assert(is_execution_policy>::value, "wrong result for is_execution_policy"); - static_assert(is_execution_policy_v>, "wrong result for is_execution_policy_v"); + assert_is_execution_policy>(); test_policy_instance(dpcpp_default); @@ -92,8 +99,7 @@ main() static_assert(std::is_same_v::kernel_name, Kernel_25>, "wrong result for kernel_name (device_policy)"); #if ONEDPL_FPGA_DEVICE - static_assert(is_execution_policy>::value, "wrong result for is_execution_policy"); - static_assert(is_execution_policy_v>, "wrong result for is_execution_policy_v"); + assert_is_execution_policy>(); test_policy_instance(dpcpp_fpga); // make_fpga_policy