From 7556605df0a9799e3cba8ba5794ca0b730dbfbd8 Mon Sep 17 00:00:00 2001 From: Sergey Kopienko <> Date: Tue, 27 Feb 2024 17:43:16 +0100 Subject: [PATCH] TestUtils::default_dpcpp_policy -> TestUtils::get_default_dpcpp_policy() --- test/general/header_order_ranges_0.pass.cpp | 2 +- test/general/header_order_ranges_1.pass.cpp | 2 +- test/general/lambda_naming.pass.cpp | 2 +- .../iterator/permutation_iterator.pass.cpp | 2 +- .../ranges/adjacent_find_ranges_sycl.pass.cpp | 2 +- .../ranges/all_any_none_of_ranges_sycl.pass.cpp | 2 +- .../parallel_api/ranges/copy_if_ranges_sycl.pass.cpp | 2 +- .../ranges/copy_ranges_factory_sycl.pass.cpp | 2 +- test/parallel_api/ranges/copy_ranges_sycl.pass.cpp | 2 +- test/parallel_api/ranges/count_ranges_sycl.pass.cpp | 2 +- test/parallel_api/ranges/equal_ranges_sycl.pass.cpp | 2 +- .../ranges/exclusive_scan_ranges_sycl.pass.cpp | 4 ++-- .../ranges/fill_generate_factory.pass.cpp | 2 +- .../ranges/find_end_ranges_sycl.pass.cpp | 2 +- test/parallel_api/ranges/find_ranges_sycl.pass.cpp | 4 ++-- .../ranges/for_each_ranges_sycl.pass.cpp | 2 +- .../ranges/inclusive_scan_ranges_sycl.pass.cpp | 4 ++-- .../ranges/is_sorted_ranges_sycl.pass.cpp | 4 ++-- .../ranges/is_sorted_until_ranges_sycl.pass.cpp | 4 ++-- test/parallel_api/ranges/merge_ranges_sycl.pass.cpp | 2 +- test/parallel_api/ranges/minmax_ranges_sycl.pass.cpp | 4 ++-- test/parallel_api/ranges/move_ranges_sycl.pass.cpp | 2 +- .../ranges/reduce_by_key_ranges_sycl.pass.cpp | 2 +- test/parallel_api/ranges/reduce_ranges_sycl.pass.cpp | 4 ++-- .../ranges/remove_if_ranges_sycl.pass.cpp | 2 +- test/parallel_api/ranges/remove_ranges_sycl.pass.cpp | 2 +- .../ranges/replace_copy_if_ranges_sycl.pass.cpp | 2 +- .../ranges/replace_copy_ranges_sycl.pass.cpp | 2 +- .../parallel_api/ranges/replace_ranges_sycl.pass.cpp | 2 +- .../ranges/reverse_copy_ranges_sycl.pass.cpp | 2 +- .../parallel_api/ranges/reverse_ranges_sycl.pass.cpp | 2 +- .../ranges/rotate_copy_ranges_sycl.pass.cpp | 2 +- test/parallel_api/ranges/rotate_view_sycl.pass.cpp | 2 +- .../ranges/search_n_ranges_sycl.pass.cpp | 2 +- test/parallel_api/ranges/search_ranges_sycl.pass.cpp | 4 ++-- test/parallel_api/ranges/sort_ranges_sycl.pass.cpp | 4 ++-- .../ranges/stable_sort_ranges_sycl.pass.cpp | 4 ++-- test/parallel_api/ranges/swap_ranges_sycl.pass.cpp | 2 +- .../ranges/transform2_ranges_factory_sycl.pass.cpp | 2 +- .../ranges/transform2_ranges_sycl.pass.cpp | 2 +- .../transform_exclusive_scan_ranges_sycl.pass.cpp | 2 +- .../transform_inclusive_scan_ranges_sycl.pass.cpp | 4 ++-- .../ranges/transform_ranges_factory_sycl.pass.cpp | 2 +- .../ranges/transform_ranges_sycl.pass.cpp | 2 +- .../ranges/transform_reduce_ranges_sycl.pass.cpp | 4 ++-- .../ranges/unique_copy_ranges_sycl.pass.cpp | 2 +- test/parallel_api/ranges/unique_ranges_sycl.pass.cpp | 2 +- test/support/utils_sycl.h | 12 ++++++++++-- 48 files changed, 69 insertions(+), 61 deletions(-) diff --git a/test/general/header_order_ranges_0.pass.cpp b/test/general/header_order_ranges_0.pass.cpp index e129cccf0c3..f0d33e43301 100644 --- a/test/general/header_order_ranges_0.pass.cpp +++ b/test/general/header_order_ranges_0.pass.cpp @@ -29,7 +29,7 @@ main() { #if _ENABLE_RANGES_TESTING using namespace oneapi::dpl::experimental::ranges; - all_of(TestUtils::default_dpcpp_policy, views::fill(-1, 10), [](auto i) { return i == -1;}); + all_of(TestUtils::get_default_dpcpp_policy(), views::fill(-1, 10), [](auto i) { return i == -1; }); #endif return TestUtils::done(_ENABLE_RANGES_TESTING); diff --git a/test/general/header_order_ranges_1.pass.cpp b/test/general/header_order_ranges_1.pass.cpp index 9dfe1107e95..ed28ba0846e 100644 --- a/test/general/header_order_ranges_1.pass.cpp +++ b/test/general/header_order_ranges_1.pass.cpp @@ -29,7 +29,7 @@ main() { #if _ENABLE_RANGES_TESTING using namespace oneapi::dpl::experimental::ranges; - all_of(TestUtils::default_dpcpp_policy, views::fill(-1, 10), [](auto i) { return i == -1;}); + all_of(TestUtils::get_default_dpcpp_policy(), views::fill(-1, 10), [](auto i) { return i == -1; }); #endif return TestUtils::done(_ENABLE_RANGES_TESTING); diff --git a/test/general/lambda_naming.pass.cpp b/test/general/lambda_naming.pass.cpp index 7ebc817e64f..6119d2de1fa 100644 --- a/test/general/lambda_naming.pass.cpp +++ b/test/general/lambda_naming.pass.cpp @@ -33,7 +33,7 @@ int main() { auto buf_begin = oneapi::dpl::begin(buf); auto buf_end = buf_begin + n; - const auto policy = TestUtils::default_dpcpp_policy; + const auto policy = TestUtils::get_default_dpcpp_policy(); auto buf_begin_discard_write = oneapi::dpl::begin(buf, sycl::write_only, sycl::property::no_init{}); ::std::fill(policy, buf_begin_discard_write, buf_begin_discard_write + n, 1); diff --git a/test/parallel_api/iterator/permutation_iterator.pass.cpp b/test/parallel_api/iterator/permutation_iterator.pass.cpp index f9d6914b07c..4aa9afa0bb9 100644 --- a/test/parallel_api/iterator/permutation_iterator.pass.cpp +++ b/test/parallel_api/iterator/permutation_iterator.pass.cpp @@ -47,7 +47,7 @@ main() "Wrong result of std::distance resultCopy(perm_size_result); - auto itCopiedDataEnd = dpl::copy(TestUtils::default_dpcpp_policy, permItBegin, permItEnd, resultCopy.begin()); + auto itCopiedDataEnd = dpl::copy(TestUtils::get_default_dpcpp_policy(), permItBegin, permItEnd, resultCopy.begin()); EXPECT_EQ(true, resultCopy.end() == itCopiedDataEnd, "Wrong result of dpl::copy"); const std::vector expectedCopy = {0, 2, 4, 6, 8, 10, 12, 14, 16, 18}; diff --git a/test/parallel_api/ranges/adjacent_find_ranges_sycl.pass.cpp b/test/parallel_api/ranges/adjacent_find_ranges_sycl.pass.cpp index d8c6e95cb0c..b816780c23b 100644 --- a/test/parallel_api/ranges/adjacent_find_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/adjacent_find_ranges_sycl.pass.cpp @@ -40,7 +40,7 @@ main() { sycl::buffer A(data, sycl::range<1>(n)); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/all_any_none_of_ranges_sycl.pass.cpp b/test/parallel_api/ranges/all_any_none_of_ranges_sycl.pass.cpp index e294379d753..d814997b360 100644 --- a/test/parallel_api/ranges/all_any_none_of_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/all_any_none_of_ranges_sycl.pass.cpp @@ -41,7 +41,7 @@ main() sycl::buffer A(data1, sycl::range<1>(max_n)); sycl::buffer B(data2, sycl::range<1>(max_n)); - auto exec1 = TestUtils::default_dpcpp_policy; + auto exec1 = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec1); auto exec2 = TestUtils::make_new_policy>(exec1); auto exec3 = TestUtils::make_new_policy>(exec1); diff --git a/test/parallel_api/ranges/copy_if_ranges_sycl.pass.cpp b/test/parallel_api/ranges/copy_if_ranges_sycl.pass.cpp index 43c06ba0e30..ac91a8dca14 100644 --- a/test/parallel_api/ranges/copy_if_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/copy_if_ranges_sycl.pass.cpp @@ -41,7 +41,7 @@ main() auto src = views::iota(0, max_n); - auto exec1 = TestUtils::default_dpcpp_policy; + auto exec1 = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec1); auto exec2 = TestUtils::make_new_policy>(exec1); auto exec3 = TestUtils::make_new_policy>(exec1); diff --git a/test/parallel_api/ranges/copy_ranges_factory_sycl.pass.cpp b/test/parallel_api/ranges/copy_ranges_factory_sycl.pass.cpp index dbe0256cd46..1dd5e691c0b 100644 --- a/test/parallel_api/ranges/copy_ranges_factory_sycl.pass.cpp +++ b/test/parallel_api/ranges/copy_ranges_factory_sycl.pass.cpp @@ -44,7 +44,7 @@ main() auto view = iota_view(0, max_n) | views::transform(lambda1); auto range_res = all_view(B); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/copy_ranges_sycl.pass.cpp b/test/parallel_api/ranges/copy_ranges_sycl.pass.cpp index 31b295740d7..a558d68c5ef 100644 --- a/test/parallel_api/ranges/copy_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/copy_ranges_sycl.pass.cpp @@ -46,7 +46,7 @@ main() auto view = views::reverse(sv) | views::transform(lambda1); auto range_res = all_view(B); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/count_ranges_sycl.pass.cpp b/test/parallel_api/ranges/count_ranges_sycl.pass.cpp index 1b71bc4f7a9..392d9bdd1df 100644 --- a/test/parallel_api/ranges/count_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/count_ranges_sycl.pass.cpp @@ -41,7 +41,7 @@ main() auto view = views::all(A); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/equal_ranges_sycl.pass.cpp b/test/parallel_api/ranges/equal_ranges_sycl.pass.cpp index 42679dc4c3d..79e4d62cc3d 100644 --- a/test/parallel_api/ranges/equal_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/equal_ranges_sycl.pass.cpp @@ -43,7 +43,7 @@ main() auto view = views::all(A); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/exclusive_scan_ranges_sycl.pass.cpp b/test/parallel_api/ranges/exclusive_scan_ranges_sycl.pass.cpp index 19152db154c..b22dcf9d3cb 100644 --- a/test/parallel_api/ranges/exclusive_scan_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/exclusive_scan_ranges_sycl.pass.cpp @@ -46,8 +46,8 @@ main() auto view = ranges::all_view(A); auto view_res1 = ranges::all_view(B1); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); ranges::exclusive_scan(exec, A, view_res1, 100); ranges::exclusive_scan(make_new_policy>(exec), view, B2, 100, ::std::plus()); diff --git a/test/parallel_api/ranges/fill_generate_factory.pass.cpp b/test/parallel_api/ranges/fill_generate_factory.pass.cpp index 22cab639650..af6144e40f1 100644 --- a/test/parallel_api/ranges/fill_generate_factory.pass.cpp +++ b/test/parallel_api/ranges/fill_generate_factory.pass.cpp @@ -52,7 +52,7 @@ main() sycl::buffer A(expected1, sycl::range<1>(max_n)); sycl::buffer B(expected2, sycl::range<1>(max_n)); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/find_end_ranges_sycl.pass.cpp b/test/parallel_api/ranges/find_end_ranges_sycl.pass.cpp index 80d9a037b1e..21076732fdd 100644 --- a/test/parallel_api/ranges/find_end_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/find_end_ranges_sycl.pass.cpp @@ -48,7 +48,7 @@ main() auto view_a = all_view(A); auto view_b = all_view(B); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/find_ranges_sycl.pass.cpp b/test/parallel_api/ranges/find_ranges_sycl.pass.cpp index b05fd9a3dbb..2f250cee87a 100644 --- a/test/parallel_api/ranges/find_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/find_ranges_sycl.pass.cpp @@ -45,8 +45,8 @@ main() auto view = all_view(A); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); res1 = find(make_new_policy>(exec), view, val); //check passing all_view res1 = find(make_new_policy>(exec), A, val); //check passing sycl::buffer directly diff --git a/test/parallel_api/ranges/for_each_ranges_sycl.pass.cpp b/test/parallel_api/ranges/for_each_ranges_sycl.pass.cpp index f18345e378f..f427f96bd0b 100644 --- a/test/parallel_api/ranges/for_each_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/for_each_ranges_sycl.pass.cpp @@ -40,7 +40,7 @@ main() { sycl::buffer A(data, sycl::range<1>(max_n)); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/inclusive_scan_ranges_sycl.pass.cpp b/test/parallel_api/ranges/inclusive_scan_ranges_sycl.pass.cpp index bc900131075..f8e9966bfd7 100644 --- a/test/parallel_api/ranges/inclusive_scan_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/inclusive_scan_ranges_sycl.pass.cpp @@ -49,8 +49,8 @@ main() auto view_res2 = ranges::all_view(B2); auto view_res3 = ranges::all_view(B3); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); ranges::inclusive_scan(exec, A, view_res1); ranges::inclusive_scan(make_new_policy>(exec), view, B2, ::std::plus()); diff --git a/test/parallel_api/ranges/is_sorted_ranges_sycl.pass.cpp b/test/parallel_api/ranges/is_sorted_ranges_sycl.pass.cpp index 02cd6dc3bd1..8c1e81260cc 100644 --- a/test/parallel_api/ranges/is_sorted_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/is_sorted_ranges_sycl.pass.cpp @@ -42,8 +42,8 @@ main() sycl::buffer A(data1, sycl::range<1>(max_n)); sycl::buffer B(data2, sycl::range<1>(max_n)); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); res1 = is_sorted(exec, all_view(A)); res2 = is_sorted(make_new_policy>(exec), B); diff --git a/test/parallel_api/ranges/is_sorted_until_ranges_sycl.pass.cpp b/test/parallel_api/ranges/is_sorted_until_ranges_sycl.pass.cpp index ea068aa2d2e..d3206c06b90 100644 --- a/test/parallel_api/ranges/is_sorted_until_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/is_sorted_until_ranges_sycl.pass.cpp @@ -43,8 +43,8 @@ main() auto view = all_view(A); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); res1 = is_sorted_until(exec, view); res2 = is_sorted_until(make_new_policy>(exec), A, [](auto a, auto b) { return a < b; }); diff --git a/test/parallel_api/ranges/merge_ranges_sycl.pass.cpp b/test/parallel_api/ranges/merge_ranges_sycl.pass.cpp index d46b5f21ad4..8a2ff7462f5 100644 --- a/test/parallel_api/ranges/merge_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/merge_ranges_sycl.pass.cpp @@ -47,7 +47,7 @@ main() sycl::buffer D(out1, sycl::range<1>(out_n)); sycl::buffer E(out2, sycl::range<1>(out_n)); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); merge(exec, all_view(A), all_view(B), all_view(D)); merge(TestUtils::make_device_policy(exec), A, B, E, ::std::less()); //check passing sycl buffers directly diff --git a/test/parallel_api/ranges/minmax_ranges_sycl.pass.cpp b/test/parallel_api/ranges/minmax_ranges_sycl.pass.cpp index 8c9d0e004ea..7429f30b418 100644 --- a/test/parallel_api/ranges/minmax_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/minmax_ranges_sycl.pass.cpp @@ -47,8 +47,8 @@ main() auto view = all_view(A); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); //min element res1 = min_element(exec, A); diff --git a/test/parallel_api/ranges/move_ranges_sycl.pass.cpp b/test/parallel_api/ranges/move_ranges_sycl.pass.cpp index 032772851d0..a2ef89849b1 100644 --- a/test/parallel_api/ranges/move_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/move_ranges_sycl.pass.cpp @@ -48,7 +48,7 @@ main() auto range_res = all_view(B); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/reduce_by_key_ranges_sycl.pass.cpp b/test/parallel_api/ranges/reduce_by_key_ranges_sycl.pass.cpp index b20ce38f985..153fd9c2e74 100644 --- a/test/parallel_api/ranges/reduce_by_key_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/reduce_by_key_ranges_sycl.pass.cpp @@ -44,7 +44,7 @@ main() using namespace TestUtils; using namespace oneapi::dpl::experimental::ranges; - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); auto res = reduce_by_segment(exec, views::all_read(A), views::all_read(B), views::all_write(C), views::all_write(D)); diff --git a/test/parallel_api/ranges/reduce_ranges_sycl.pass.cpp b/test/parallel_api/ranges/reduce_ranges_sycl.pass.cpp index 7531326a7ab..72af2411740 100644 --- a/test/parallel_api/ranges/reduce_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/reduce_ranges_sycl.pass.cpp @@ -40,8 +40,8 @@ main() auto view = all_view(A); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); res1 = reduce(exec, A); res2 = reduce(make_new_policy>(exec), view, 100); diff --git a/test/parallel_api/ranges/remove_if_ranges_sycl.pass.cpp b/test/parallel_api/ranges/remove_if_ranges_sycl.pass.cpp index 1524887cc76..5a7dacc4253 100644 --- a/test/parallel_api/ranges/remove_if_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/remove_if_ranges_sycl.pass.cpp @@ -43,7 +43,7 @@ main() { sycl::buffer A(in.data(), sycl::range<1>(in.size())); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/remove_ranges_sycl.pass.cpp b/test/parallel_api/ranges/remove_ranges_sycl.pass.cpp index 11c92afe1b2..1cdb97613b7 100644 --- a/test/parallel_api/ranges/remove_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/remove_ranges_sycl.pass.cpp @@ -43,7 +43,7 @@ main() { sycl::buffer A(in.data(), sycl::range<1>(in.size())); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/replace_copy_if_ranges_sycl.pass.cpp b/test/parallel_api/ranges/replace_copy_if_ranges_sycl.pass.cpp index 9daf503210e..78b70d176e6 100644 --- a/test/parallel_api/ranges/replace_copy_if_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/replace_copy_if_ranges_sycl.pass.cpp @@ -39,7 +39,7 @@ main() sycl::buffer A(max_n); auto src = views::iota(0, max_n); - auto res = replace_copy_if(TestUtils::default_dpcpp_policy, src, A, pred, new_val); + auto res = replace_copy_if(TestUtils::get_default_dpcpp_policy(), src, A, pred, new_val); //check result int expected[max_n]; diff --git a/test/parallel_api/ranges/replace_copy_ranges_sycl.pass.cpp b/test/parallel_api/ranges/replace_copy_ranges_sycl.pass.cpp index a414a1d0cff..93e41a83783 100644 --- a/test/parallel_api/ranges/replace_copy_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/replace_copy_ranges_sycl.pass.cpp @@ -39,7 +39,7 @@ main() sycl::buffer A(max_n); auto src = views::fill(old_val, max_n); - auto res = replace_copy(TestUtils::default_dpcpp_policy, src, A, old_val, new_val); + auto res = replace_copy(TestUtils::get_default_dpcpp_policy(), src, A, old_val, new_val); //check result EXPECT_TRUE(res == max_n, "wrong result from replace_copy"); diff --git a/test/parallel_api/ranges/replace_ranges_sycl.pass.cpp b/test/parallel_api/ranges/replace_ranges_sycl.pass.cpp index 4095f32bb26..ce3cded5a63 100644 --- a/test/parallel_api/ranges/replace_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/replace_ranges_sycl.pass.cpp @@ -43,7 +43,7 @@ main() auto view = views::all(A); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/reverse_copy_ranges_sycl.pass.cpp b/test/parallel_api/ranges/reverse_copy_ranges_sycl.pass.cpp index 1619ddfc9e7..f45e1479651 100644 --- a/test/parallel_api/ranges/reverse_copy_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/reverse_copy_ranges_sycl.pass.cpp @@ -37,7 +37,7 @@ main() sycl::buffer A(max_n); auto src = views::iota(0, max_n); - auto res = reverse_copy(TestUtils::default_dpcpp_policy, src, A); + auto res = reverse_copy(TestUtils::get_default_dpcpp_policy(), src, A); //check result EXPECT_TRUE(res == max_n, "wrong result from reverse_copy"); diff --git a/test/parallel_api/ranges/reverse_ranges_sycl.pass.cpp b/test/parallel_api/ranges/reverse_ranges_sycl.pass.cpp index bc55f6203ae..8a01f3742bd 100644 --- a/test/parallel_api/ranges/reverse_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/reverse_ranges_sycl.pass.cpp @@ -39,7 +39,7 @@ main() auto iota = views::iota(0, max_n); //the name nano::ranges::copy is not injected into oneapi::dpl::experimental::ranges namespace __nanorange::nano::ranges::copy(iota, views::host_all(A).begin()); - reverse(TestUtils::default_dpcpp_policy, A); + reverse(TestUtils::get_default_dpcpp_policy(), A); for(auto v: views::host_all(A)) ::std::cout << v << " "; diff --git a/test/parallel_api/ranges/rotate_copy_ranges_sycl.pass.cpp b/test/parallel_api/ranges/rotate_copy_ranges_sycl.pass.cpp index a261e371505..46c00546e55 100644 --- a/test/parallel_api/ranges/rotate_copy_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/rotate_copy_ranges_sycl.pass.cpp @@ -38,7 +38,7 @@ main() sycl::buffer A(max_n); auto src = views::iota(0, max_n); - auto res = rotate_copy(TestUtils::default_dpcpp_policy, src, rotate_val, A); + auto res = rotate_copy(TestUtils::get_default_dpcpp_policy(), src, rotate_val, A); //check result EXPECT_TRUE(res == max_n, "wrong result from rotate_copy"); diff --git a/test/parallel_api/ranges/rotate_view_sycl.pass.cpp b/test/parallel_api/ranges/rotate_view_sycl.pass.cpp index dbc03759728..c6e5329165d 100644 --- a/test/parallel_api/ranges/rotate_view_sycl.pass.cpp +++ b/test/parallel_api/ranges/rotate_view_sycl.pass.cpp @@ -39,7 +39,7 @@ main() { sycl::buffer A(data, sycl::range<1>(max_n)); sycl::buffer B(expected, sycl::range<1>(max_n)); - ranges::copy(TestUtils::default_dpcpp_policy, + ranges::copy(TestUtils::get_default_dpcpp_policy(), ranges::views::all_read(A) | ranges::views::rotate(rotate_val), ranges::views::all_write(B)); } diff --git a/test/parallel_api/ranges/search_n_ranges_sycl.pass.cpp b/test/parallel_api/ranges/search_n_ranges_sycl.pass.cpp index 7b72944ce33..d691f81e7cd 100644 --- a/test/parallel_api/ranges/search_n_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/search_n_ranges_sycl.pass.cpp @@ -43,7 +43,7 @@ main() auto view_a = all_view(A); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/search_ranges_sycl.pass.cpp b/test/parallel_api/ranges/search_ranges_sycl.pass.cpp index 878a79377d2..109bba270de 100644 --- a/test/parallel_api/ranges/search_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/search_ranges_sycl.pass.cpp @@ -47,8 +47,8 @@ main() auto view_a = all_view(A); auto view_b = all_view(B); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); res1 = search(exec, A, view_b); res2 = search(make_new_policy>(exec), view_a, B, [](auto a, auto b) { return a == b; }); diff --git a/test/parallel_api/ranges/sort_ranges_sycl.pass.cpp b/test/parallel_api/ranges/sort_ranges_sycl.pass.cpp index 8e1869e4eea..ee1c238c1d1 100644 --- a/test/parallel_api/ranges/sort_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/sort_ranges_sycl.pass.cpp @@ -40,8 +40,8 @@ main() using namespace TestUtils; using namespace oneapi::dpl::experimental::ranges; - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); { sycl::buffer A(data1, sycl::range<1>(max_n)); sycl::buffer B(data2, sycl::range<1>(max_n)); diff --git a/test/parallel_api/ranges/stable_sort_ranges_sycl.pass.cpp b/test/parallel_api/ranges/stable_sort_ranges_sycl.pass.cpp index 6006d43f5d6..1a5f3034670 100644 --- a/test/parallel_api/ranges/stable_sort_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/stable_sort_ranges_sycl.pass.cpp @@ -39,8 +39,8 @@ main() sycl::buffer A(data1, sycl::range<1>(max_n)); sycl::buffer B(data2, sycl::range<1>(max_n)); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); stable_sort(exec, A); //check passing sycl buffer directly stable_sort(make_new_policy>(exec), all_view(B), diff --git a/test/parallel_api/ranges/swap_ranges_sycl.pass.cpp b/test/parallel_api/ranges/swap_ranges_sycl.pass.cpp index be6195556c5..90b024f2176 100644 --- a/test/parallel_api/ranges/swap_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/swap_ranges_sycl.pass.cpp @@ -43,7 +43,7 @@ main() sycl::buffer C(data3, sycl::range<1>(max_n_2)); sycl::buffer D(data4, sycl::range<1>(max_n)); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/transform2_ranges_factory_sycl.pass.cpp b/test/parallel_api/ranges/transform2_ranges_factory_sycl.pass.cpp index 90a53e2ef50..6370acea8c8 100644 --- a/test/parallel_api/ranges/transform2_ranges_factory_sycl.pass.cpp +++ b/test/parallel_api/ranges/transform2_ranges_factory_sycl.pass.cpp @@ -46,7 +46,7 @@ main() auto view = iota_view(0, max_n) | views::transform(lambda1); auto range_res = all_view(B); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/transform2_ranges_sycl.pass.cpp b/test/parallel_api/ranges/transform2_ranges_sycl.pass.cpp index b6ddd6ddea7..b720ec83fdd 100644 --- a/test/parallel_api/ranges/transform2_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/transform2_ranges_sycl.pass.cpp @@ -46,7 +46,7 @@ main() auto view = views::reverse(sv) | views::transform(lambda1); auto range_res = all_view(B); - transform(TestUtils::default_dpcpp_policy, view, view, range_res, lambda2); + transform(TestUtils::get_default_dpcpp_policy(), view, view, range_res, lambda2); } //check result diff --git a/test/parallel_api/ranges/transform_exclusive_scan_ranges_sycl.pass.cpp b/test/parallel_api/ranges/transform_exclusive_scan_ranges_sycl.pass.cpp index 970c159fcf1..e6d867756e8 100644 --- a/test/parallel_api/ranges/transform_exclusive_scan_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/transform_exclusive_scan_ranges_sycl.pass.cpp @@ -47,7 +47,7 @@ main() auto view = ranges::all_view(A); auto view_res = ranges::all_view(B); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/transform_inclusive_scan_ranges_sycl.pass.cpp b/test/parallel_api/ranges/transform_inclusive_scan_ranges_sycl.pass.cpp index de405ff1fd0..2c92baffc8e 100644 --- a/test/parallel_api/ranges/transform_inclusive_scan_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/transform_inclusive_scan_ranges_sycl.pass.cpp @@ -48,8 +48,8 @@ main() auto view = ranges::all_view(A); auto view_res1 = ranges::all_view(B1); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); ranges::transform_inclusive_scan(exec, A, view_res1, ::std::plus(), lambda); ranges::transform_inclusive_scan(make_new_policy>(exec), view, B2, ::std::plus(), lambda, init); diff --git a/test/parallel_api/ranges/transform_ranges_factory_sycl.pass.cpp b/test/parallel_api/ranges/transform_ranges_factory_sycl.pass.cpp index 0833a4a14a7..3ff2bf1e4d0 100644 --- a/test/parallel_api/ranges/transform_ranges_factory_sycl.pass.cpp +++ b/test/parallel_api/ranges/transform_ranges_factory_sycl.pass.cpp @@ -46,7 +46,7 @@ main() auto view = iota_view(0, max_n) | views::transform(lambda1); auto range_res = all_view(B); - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/transform_ranges_sycl.pass.cpp b/test/parallel_api/ranges/transform_ranges_sycl.pass.cpp index ac4ce8790ac..41902308663 100644 --- a/test/parallel_api/ranges/transform_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/transform_ranges_sycl.pass.cpp @@ -46,7 +46,7 @@ main() auto view = views::reverse(sv) | views::transform(lambda1); auto range_res = all_view(B); - transform(TestUtils::default_dpcpp_policy, view, range_res, lambda2); + transform(TestUtils::get_default_dpcpp_policy(), view, range_res, lambda2); } //check result diff --git a/test/parallel_api/ranges/transform_reduce_ranges_sycl.pass.cpp b/test/parallel_api/ranges/transform_reduce_ranges_sycl.pass.cpp index a10e90d99b0..35dbbc1f76e 100644 --- a/test/parallel_api/ranges/transform_reduce_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/transform_reduce_ranges_sycl.pass.cpp @@ -42,8 +42,8 @@ main() auto view = oneapi::dpl::experimental::ranges::all_view(A); - auto exec = TestUtils::default_dpcpp_policy; - using Policy = decltype(TestUtils::default_dpcpp_policy); + auto exec = TestUtils::get_default_dpcpp_policy(); + using Policy = decltype(exec); res1 = oneapi::dpl::experimental::ranges::transform_reduce(exec, A, view, 0); res2 = oneapi::dpl::experimental::ranges::transform_reduce(make_new_policy>(exec), view, A, 0, ::std::plus(), ::std::multiplies()); diff --git a/test/parallel_api/ranges/unique_copy_ranges_sycl.pass.cpp b/test/parallel_api/ranges/unique_copy_ranges_sycl.pass.cpp index 0d606188ecf..e03981b9280 100644 --- a/test/parallel_api/ranges/unique_copy_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/unique_copy_ranges_sycl.pass.cpp @@ -35,7 +35,7 @@ main() auto is_equal = [](auto i, auto j) { return i == j; }; - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/parallel_api/ranges/unique_ranges_sycl.pass.cpp b/test/parallel_api/ranges/unique_ranges_sycl.pass.cpp index e8db2f5bde1..1e770e5e96a 100644 --- a/test/parallel_api/ranges/unique_ranges_sycl.pass.cpp +++ b/test/parallel_api/ranges/unique_ranges_sycl.pass.cpp @@ -35,7 +35,7 @@ main() auto is_equal = [](auto i, auto j) { return i == j; }; - auto exec = TestUtils::default_dpcpp_policy; + auto exec = TestUtils::get_default_dpcpp_policy(); using Policy = decltype(exec); auto exec1 = TestUtils::make_new_policy>(exec); auto exec2 = TestUtils::make_new_policy>(exec); diff --git a/test/support/utils_sycl.h b/test/support/utils_sycl.h index 0a454987931..e584e7122ad 100644 --- a/test/support/utils_sycl.h +++ b/test/support/utils_sycl.h @@ -115,12 +115,16 @@ get_default_selector() # endif // ONEDPL_FPGA_EMULATOR } -inline auto&& default_dpcpp_policy = +auto +get_default_dpcpp_policy() +{ + return # if ONEDPL_USE_PREDEFINED_POLICIES oneapi::dpl::execution::dpcpp_fpga; # else TestUtils::make_fpga_policy(sycl::queue{get_default_selector()}); # endif // ONEDPL_USE_PREDEFINED_POLICIES +} #else auto get_default_selector() @@ -133,12 +137,16 @@ get_default_selector() # endif } -inline auto&& default_dpcpp_policy = +auto +get_default_dpcpp_policy() +{ + return # if ONEDPL_USE_PREDEFINED_POLICIES oneapi::dpl::execution::dpcpp_default; # else oneapi::dpl::execution::make_device_policy(sycl::queue{get_default_selector()}); # endif // ONEDPL_USE_PREDEFINED_POLICIES +} #endif // ONEDPL_FPGA_DEVICE inline