-
Notifications
You must be signed in to change notification settings - Fork 115
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
Avoid if
call in the __parallel_merge_submitter_large::run_parallel_merge()
#1980
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f3d640e
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h - …
SergeyKopienko 31f9f7e
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h - …
SergeyKopienko def2bb6
Merge branch 'main' into dev/skopienko/avoid_if_in_merge
SergeyKopienko 9d79209
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h - …
SergeyKopienko b076619
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h - …
SergeyKopienko 70f16c6
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h - …
SergeyKopienko 517df68
Merge branch 'main' into dev/skopienko/avoid_if_in_merge
SergeyKopienko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,6 +278,15 @@ struct __parallel_merge_submitter_large<_IdType, _CustomName, | |
}); | ||
} | ||
|
||
template <typename _Rng1, typename _Rng2, typename _Compare> | ||
inline static _split_point_t<_IdType> | ||
__find_start_point_w(const _Rng1& __rng1, const _Rng2& __rng2, const _split_point_t<_IdType>& __sp_left, | ||
const _split_point_t<_IdType>& __sp_right, const _IdType __i_elem, _Compare __comp) | ||
{ | ||
return __find_start_point(__rng1, __sp_left.first, __sp_right.first, __rng2, __sp_left.second, | ||
__sp_right.second, __i_elem, __comp); | ||
} | ||
|
||
// Process parallel merge | ||
template <typename _ExecutionPolicy, typename _Range1, typename _Range2, typename _Range3, typename _Compare, | ||
typename _Storage> | ||
|
@@ -306,19 +315,11 @@ struct __parallel_merge_submitter_large<_IdType, _CustomName, | |
_Storage::__get_usm_or_buffer_accessor_ptr(__base_diagonals_sp_global_acc); | ||
auto __diagonal_idx = __global_idx / __nd_range_params.steps_between_two_base_diags; | ||
|
||
_split_point_t<_IdType> __start; | ||
if (__global_idx % __nd_range_params.steps_between_two_base_diags != 0) | ||
{ | ||
const _split_point_t<_IdType> __sp_left = __base_diagonals_sp_global_ptr[__diagonal_idx]; | ||
const _split_point_t<_IdType> __sp_right = __base_diagonals_sp_global_ptr[__diagonal_idx + 1]; | ||
|
||
__start = __find_start_point(__rng1, __sp_left.first, __sp_right.first, __rng2, | ||
__sp_left.second, __sp_right.second, __i_elem, __comp); | ||
} | ||
else | ||
{ | ||
__start = __base_diagonals_sp_global_ptr[__diagonal_idx]; | ||
} | ||
const _split_point_t<_IdType> __start = | ||
__global_idx % __nd_range_params.steps_between_two_base_diags != 0 | ||
? __find_start_point_w(__rng1, __rng2, __base_diagonals_sp_global_ptr[__diagonal_idx], | ||
__base_diagonals_sp_global_ptr[__diagonal_idx + 1], __i_elem, __comp) | ||
: __base_diagonals_sp_global_ptr[__diagonal_idx]; | ||
Comment on lines
+318
to
+322
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From a performance perspective, as far as I know a ternary operator ( Is this PR intended to clean up the code to be improve readability or performance? |
||
|
||
__serial_merge(__rng1, __rng2, __rng3, __start.first, __start.second, __i_elem, | ||
__nd_range_params.chunk, __n1, __n2, __comp); | ||
|
Oops, something went wrong.
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.
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.
What's a purpose of
__find_start_point_w
? It seems, it does not any additional things, beside re-calling__find_start_point
...