-
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
Remove duplicated host buffer implementations from oneDPL code #1452
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SergeyKopienko
force-pushed
the
dev/skopienko/host_buffer_impl_refacotring
branch
from
March 19, 2024 11:40
5b08a0e
to
652f970
Compare
SergeyKopienko
force-pushed
the
dev/skopienko/host_buffer_impl_refacotring
branch
2 times, most recently
from
March 21, 2024 14:51
5c65b8a
to
0ebe195
Compare
SergeyKopienko
force-pushed
the
dev/skopienko/host_buffer_impl_refacotring
branch
from
March 22, 2024 13:36
fb97fa1
to
fe9eedf
Compare
SergeyKopienko
force-pushed
the
dev/skopienko/host_buffer_impl_refacotring
branch
2 times, most recently
from
April 5, 2024 15:15
04bb28d
to
350ee9c
Compare
SergeyKopienko
force-pushed
the
dev/skopienko/host_buffer_impl_refacotring
branch
8 times, most recently
from
April 10, 2024 07:37
f3e20ef
to
fcad11f
Compare
…add static_assert(::std::is_base_of_v<__device_backend_tag, _BackendTag>) into class __buffer_impl_hetero
…_tag) into include/oneapi/dpl/pstl/parallel_backend_serial.h and remove from forward declarations in include/oneapi/dpl/pstl/execution_defs.h
…_tag) into include/oneapi/dpl/pstl/parallel_backend_serial.h and remove from forward declarations in include/oneapi/dpl/pstl/execution_defs.h - fix compile error by introducing oneapi::dpl::__internal::__serial_buffer_allocator type
…eapi::dpl::__internal’; did you mean ‘__get_buffer_allocator’?
…selector ans it's allocator_type
SergeyKopienko
force-pushed
the
dev/skopienko/host_buffer_impl_refacotring
branch
from
April 10, 2024 08:15
fcad11f
to
3057616
Compare
Required additional design work. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goals of this PR:
__buffer
for all backend (serial
,tbb
andomp
) due avoid code duplications.At this moment our three implementations of host
__buffer
is absolutly the same excepting the allocators, which they are using:serial
backend implementation - usingstd::allocator
;tbb
backend implementation - usingtbb::tbb_allocator
;omp
backend implementation - usingstd::allocator
.In this PR we are not going to break these rules, but will specify using allocator by additional template param of `__buffer' implementation class.
Implementation details
Now we have only one
class __buffer_impl
in oneDPL code and it's renamed toclass __buffer_impl_host
:The definition of
__buffer
template alias inside each of host backends looks likeOne important detail here - in the template param
_BackendOrDispatchTag
we are ready to receive:__serial_backend_tag
,__tbb_backend_tag
and__omp_backend_tag
;__serial_tag
,__parallel_tag
and__parallel_forward_tag
.Also now we can specify which allocator we will use in this buffer through template param
_TAllocator
:serial
andomp
backends it's::std::allocator
;tbb
backend it'stbb::tbb_allocator
.For support tag dispatching and use different allocators the the host buffer now we using the type
allocator_type
from__backend_buffer_allocator_selector
structure specializations :This structure
__backend_buffer_allocator_selector
also has specializations for resolve dispatching tags into buffer allocators:As result now we have only one implementation of host
__buffer
with different using allocators which depends on or .