diff --git a/include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h b/include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h index 330a4556137..5e8ffa3223e 100644 --- a/include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h +++ b/include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h @@ -157,8 +157,8 @@ struct none_of_fn constexpr oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> operator()(_ExecutionPolicy&& __exec, _R&& __r, _Pred __pred, _Proj __proj) const { - return !oneapi::dpl::ranges::any_of(::std::forward<_ExecutionPolicy>(__exec), - oneapi::dpl::views::all_read(::std::forward<_R>(__r)), __pred, __proj); + return !oneapi::dpl::ranges::any_of(::std::forward<_ExecutionPolicy>(__exec), std::forward<_R>(__r), + __pred, __proj); } }; //none_of_fn @@ -204,15 +204,17 @@ struct search_n_fn operator()(_ExecutionPolicy&& __exec, _R&& __r, std::ranges::range_difference_t<_R> __count, const _T& __value, _Pred __pred, _Proj __proj) const { - const auto __dispatch_tag = oneapi::dpl::__internal::__select_backend(__exec, __r); + const auto __dispatch_tag = oneapi::dpl::__internal::__select_backend(__exec, __r.begin()); return oneapi::dpl::__internal::__ranges::__pattern_search_n(__dispatch_tag, std::forward<_ExecutionPolicy>(__exec), std::forward<_R>(__r), __count, __value, __pred, __proj); } }; //search_n_fn } //ranges -#endif +#endif //_ONEDPL___cplusplus >= 202002L + +#if _ONEDPL_HETERO_BACKEND namespace experimental { namespace ranges @@ -928,6 +930,9 @@ reduce_by_segment(_ExecutionPolicy&& __exec, _Range1&& __keys, _Range2&& __value } // namespace ranges } // namespace experimental + +#endif //_ONEDPL_HETERO_BACKEND + } // namespace dpl } // namespace oneapi diff --git a/include/oneapi/dpl/pstl/glue_numeric_ranges_impl.h b/include/oneapi/dpl/pstl/glue_numeric_ranges_impl.h index 521ebee46b7..d6238f5c265 100644 --- a/include/oneapi/dpl/pstl/glue_numeric_ranges_impl.h +++ b/include/oneapi/dpl/pstl/glue_numeric_ranges_impl.h @@ -21,7 +21,6 @@ #if _ONEDPL_HETERO_BACKEND # include "hetero/numeric_ranges_impl_hetero.h" -#endif namespace oneapi { @@ -204,4 +203,6 @@ transform_inclusive_scan(_ExecutionPolicy&& __exec, _Range1&& __rng1, _Range2&& } // namespace dpl } // namespace oneapi +#endif //_ONEDPL_HETERO_BACKEND + #endif // _ONEDPL_GLUE_NUMERIC_RANGES_IMPL_H diff --git a/include/oneapi/dpl/pstl/ranges_defs.h b/include/oneapi/dpl/pstl/ranges_defs.h index 0bf0dff62ec..6d8d29ac4fe 100644 --- a/include/oneapi/dpl/pstl/ranges_defs.h +++ b/include/oneapi/dpl/pstl/ranges_defs.h @@ -19,6 +19,7 @@ #include "ranges/nanorange.hpp" #include "ranges/nanorange_ext.h" +#include "utils_ranges.h" #if _ONEDPL_BACKEND_SYCL # include "hetero/dpcpp/utils_ranges_sycl.h" #endif @@ -28,12 +29,14 @@ namespace oneapi namespace dpl { +#if _ONEDPL_BACKEND_SYCL namespace views { using oneapi::dpl::__ranges::views::all; using oneapi::dpl::__ranges::views::all_read; using oneapi::dpl::__ranges::views::all_write; } +#endif // _ONEDPL_BACKEND_SYCL namespace experimental { @@ -41,7 +44,9 @@ namespace ranges { //custom views +#if _ONEDPL_BACKEND_SYCL using oneapi::dpl::__ranges::all_view; +#endif // _ONEDPL_BACKEND_SYCL using oneapi::dpl::__ranges::guard_view; using oneapi::dpl::__ranges::zip_view; @@ -55,11 +60,12 @@ using __nanorange::nano::ranges::transform_view; //adaptors namespace views { +#if _ONEDPL_BACKEND_SYCL using oneapi::dpl::__ranges::views::all; using oneapi::dpl::__ranges::views::all_read; using oneapi::dpl::__ranges::views::all_write; - using oneapi::dpl::__ranges::views::host_all; +#endif // _ONEDPL_BACKEND_SYCL using __nanorange::nano::views::drop; using __nanorange::nano::views::fill; diff --git a/test/parallel_api/ranges/std_ranges_test.h b/test/parallel_api/ranges/std_ranges_test.h index 567b5c2bd4a..1aa777ad831 100644 --- a/test/parallel_api/ranges/std_ranges_test.h +++ b/test/parallel_api/ranges/std_ranges_test.h @@ -32,6 +32,7 @@ namespace test_std_ranges {; +#if _ONEDPL_HETERO_BACKEND template auto dpcpp_policy() { @@ -39,6 +40,7 @@ auto dpcpp_policy() using Policy = decltype(exec); return TestUtils::make_new_policy>(TestUtils::default_dpcpp_policy); } +#endif //_ONEDPL_HETERO_BACKEND auto host_policies() { return std::true_type{};} @@ -217,6 +219,7 @@ struct test } }; +#if _ONEDPL_HETERO_BACKEND struct sycl_buffer { using type = sycl::buffer; @@ -229,6 +232,7 @@ struct sycl_buffer return buf; } }; +#endif //#if _ONEDPL_HETERO_BACKEND template struct host_subrange_impl @@ -265,6 +269,7 @@ struct host_vector } }; +#if _ONEDPL_HETERO_BACKEND struct usm_vector { using shared_allocator = sycl::usm_allocator; @@ -321,6 +326,8 @@ struct usm_subrange_impl using usm_subrange = usm_subrange_impl>; using usm_span = usm_subrange_impl>; +#endif // _ONEDPL_HETERO_BACKEND + template struct test_range_algo { @@ -343,6 +350,7 @@ struct test_range_algo test{}(host_policies(), algo, checker, f, proj, std::views::all); test{}(host_policies(), algo, checker, f, proj, std::views::all); +#if _ONEDPL_HETERO_BACKEND test{}(dpcpp_policy(), algo, checker, f, proj); test{}(dpcpp_policy(), algo, checker, f, proj, oneapi::dpl::views::all); test{}(dpcpp_policy(), algo, checker, f, proj, subrange_view); @@ -353,6 +361,8 @@ struct test_range_algo #if 0 //sycl buffer test{}(dpcpp_policy(), algo, checker, f, std::identity{}, oneapi::dpl::views::all); #endif + +#endif //_ONEDPL_HETERO_BACKEND } };