Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsecutive implementation of __select_backend - V1 #1456

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/oneapi/dpl/pstl/execution_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ __select_backend(oneapi::dpl::execution::sequenced_policy, _IteratorTypes&&...)
}

template <class... _IteratorTypes>
__serial_tag<__internal::__is_random_access_iterator<_IteratorTypes...>>
__serial_tag<__internal::__is_random_access_iterator_t<_IteratorTypes...>>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mean we will use here the std::true_type or std::false_type only.

__select_backend(oneapi::dpl::execution::unsequenced_policy, _IteratorTypes&&...)
{
return {};
Expand All @@ -94,7 +94,7 @@ __select_backend(oneapi::dpl::execution::parallel_policy, _IteratorTypes&&...)
}

template <class... _IteratorTypes>
__parallel_policy_tag_selector_t<__internal::__is_random_access_iterator<_IteratorTypes...>, _IteratorTypes...>
__parallel_policy_tag_selector_t<__internal::__is_random_access_iterator_t<_IteratorTypes...>, _IteratorTypes...>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mean we will use here the std::true_type or std::false_type only.

__select_backend(oneapi::dpl::execution::parallel_unsequenced_policy, _IteratorTypes&&...)
{
return {};
Expand Down
3 changes: 3 additions & 0 deletions include/oneapi/dpl/pstl/iterator_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ struct __is_forward_iterator : decltype(__is_iterator_of<::std::forward_iterator
{
};

template <typename... _IteratorTypes>
using __is_random_access_iterator_t = typename __is_random_access_iterator<_IteratorTypes...>::type;

template <typename... _IteratorTypes>
inline constexpr bool __is_random_access_iterator_v = __is_random_access_iterator<_IteratorTypes...>::value;

Expand Down
Loading