diff --git a/include/oneapi/dpl/pstl/hetero/dpcpp/sycl_iterator.h b/include/oneapi/dpl/pstl/hetero/dpcpp/sycl_iterator.h index 27bfb0d4a88..a38d6520b4f 100644 --- a/include/oneapi/dpl/pstl/hetero/dpcpp/sycl_iterator.h +++ b/include/oneapi/dpl/pstl/hetero/dpcpp/sycl_iterator.h @@ -177,6 +177,36 @@ struct __vector_iter_distinguishes_by_allocator< { }; +template +struct __is_known_usm_vector_iter_impl : std::false_type +{ +}; + +template +struct __is_known_usm_vector_iter_impl< + Iter, std::enable_if_t>, + std::is_same>>, + oneapi::dpl::__internal::__vector_iter_distinguishes_by_allocator>::value>> : std::true_type +{ +}; + +template +struct __is_known_usm_vector_iter : std::false_type +{ +}; + +//We must avoid instantiating vector of const, reference, or function elements to avoid ill-formed vector instantiation +template +struct __is_known_usm_vector_iter< + Iter, std::enable_if_t::value_type>, + std::is_reference::value_type>, + std::is_function::value_type>>>, + oneapi::dpl::__internal::__is_known_usm_vector_iter_impl>::value>> : std::true_type +{ +}; + } // namespace __internal template diff --git a/include/oneapi/dpl/pstl/hetero/dpcpp/utils_ranges_sycl.h b/include/oneapi/dpl/pstl/hetero/dpcpp/utils_ranges_sycl.h index 9351b20dc88..4e2f8626950 100644 --- a/include/oneapi/dpl/pstl/hetero/dpcpp/utils_ranges_sycl.h +++ b/include/oneapi/dpl/pstl/hetero/dpcpp/utils_ranges_sycl.h @@ -209,11 +209,8 @@ struct is_passed_directly -struct is_passed_directly< - Iter, std::enable_if_t<(std::is_same_v> || - std::is_same_v>) && - oneapi::dpl::__internal::__vector_iter_distinguishes_by_allocator::value>> : - std::true_type +struct is_passed_directly::value>> + : std::true_type { };