-
Notifications
You must be signed in to change notification settings - Fork 113
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
Inconsecutive implementation of __select_backend
- V1
#1456
Conversation
@@ -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...>> |
There was a problem hiding this comment.
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.
@@ -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...> |
There was a problem hiding this comment.
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.
51b55b1
to
87e15ef
Compare
…_is_random_access_iterator_t type
…rator_t instead of __is_random_access_iterato in dispatch tag specializations
87e15ef
to
74e3b10
Compare
Discussed offline: |
Here is another implementation of #1455
This PR based on prototype from @rarutyun
Source prototype has been placed here:
!!! ATTENTION !!!
in this PR we disable
for_loop
staff for hetero policies:for_loop
;for_loop_n
;for_loop_strided
;for_loop_n_strided
.Tag dispatching mechanism:
select_backend
function)__serial_backend_tag
,__tbb_backend_tag
,__omp_backend_tag
,__device_backend_tag
,__fpga_backend_tag
,is_vector
.Overall schema of tag dispatching:
Algorithm level - first level:
const auto __dispatch_tag = oneapi::dpl::__internal::__select_backend(__exec, ...);
on algorithm level;__dispatch_tag
into patterns;Pattern level - second level:
_BackendTag
from the fist__Tag
parameter type;_BackendTag{}
(instance of the backend tag into backend implementation.Host backend tags:
Hetero backend tags:
Types of dispatching tags (host tags):
Types of dispatching tags (hetero tags):
How we define
__par_backend_tag
:Typical changes in the code
Changes in pattern calls:
Functions with
enable_if_..._policy<...>
and/*parallel=*/::std::false_type
before:
after:
_IsVector
type astypename _Tag::__is_vector
Functions with
__enable_if_host_execution_policy_conditional
,__is_random_access_iterator_v
and/*parallel=*/::std::true_type
before:
after:
Functions with
enable_if_..._policy<...>
and/*parallel=*/::std::true_type
before:
after:
in these functions we move
class _IsVector
to first template param place.Functions with
__enable_if_device_execution_policy
before:
after:
Changes in the
oneDPL
host policy classesAs result of this work now we have more clear host policy classes:
All functions like
__allow_unsequenced
,__allow_vector
and__allow_parallel
has been removed from these classes as not required anymore.__select_backend()
functions__select_backend()
functions for host policies and iterators__select_backend()
functions for hetero policies and iterators__select_backend()
functions for hetero policies and ranges (in the namespace__ranges
)