-
Notifications
You must be signed in to change notification settings - Fork 114
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
Fix performance issue in __serial_merge
#2022
Fix performance issue in __serial_merge
#2022
Conversation
…fix __serial_merge implementation: using ternary operator / assign operator with SFINAE
…fix __serial_merge implementation: using ternary operator / assign operator with SFINAE
…fix __serial_merge implementation: using ternary operator / assign operator with SFINAE
…fix __serial_merge implementation: using ternary operator / assign operator with SFINAE
…remove __assing_impl function
…optimize condition check sue it's always calculated from left to right
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h
Outdated
Show resolved
Hide resolved
…rge.h - remove __assing_impl function" - reverted due compile errors in https://github.com/uxlfoundation/oneDPL/actions/runs/12988989427/job/36221124714?pr=2022 oneDPL\include\oneapi\dpl\pstl\hetero\dpcpp\parallel_backend_sycl_merge.h(175,58): error: SYCL kernel cannot call a variadic function 175 | if constexpr (__can_use_ternary_op<_Rng1, _Rng2>().value) | ^ oneDPL\include\oneapi\dpl\pstl\hetero\dpcpp\parallel_backend_sycl_merge.h(350,21): note: called by 'operator()' 350 | __serial_merge(__rng1, __rng2, __rng3, __start.first, __start.second, __i_elem, | ^ include\sycl\handler.hpp(405,7): note: called by 'operator()' 405 | KernelFunc(item); | ^
…fir review comment: additional comments
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h
Outdated
Show resolved
Hide resolved
…remove __assing_impl function and fix compile error in __can_use_ternary_op call
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h
Outdated
Show resolved
Hide resolved
…ge.h Co-authored-by: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com>
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h
Outdated
Show resolved
Hide resolved
…fix review comment
…fix review comment
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.
I think this looks good, but should have a second set of eyes on it.
Also, we should confirm that the reported bug is still fixed, and the performance regression disappears for the normal case.
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h
Outdated
Show resolved
Hide resolved
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.
LGTM, wait for green CI
…apply GitHUB clang format
…fix review comment: let's use real data types
…fix review comment: let's use real data types
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h
Outdated
Show resolved
Hide resolved
…fix review comment
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.
LGTM :) third time is a charm
…apply GitHUB clang format
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.
Looks reasonable.
But before merging into the main I suggest being sure that CI and a case with tuple type issue (which was before) are passed.
This is the second attempt of #2013: the source compile error has been introduced in the PR #1970
Example of the source compile error: https://godbolt.org/z/x6z7GMv1W
In the PR #2013 I detected performance issue.
The goal of this PR - to use ternary operator when it's possible.
Checks on GodBold:
__assing_impl
__assing_impl
Thanks to @MikeDvorskiy and @dmitriy-sobolev for their implementations of
__can_use_ternary_op_v
!