-
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
Make Unique family of APIs use reduce_then_scan #1765
Conversation
013c496
to
dadb933
Compare
8a9abd7
to
f481951
Compare
dadb933
to
eafdcc0
Compare
f481951
to
6a7bae0
Compare
eafdcc0
to
c7c043e
Compare
6a7bae0
to
019a6c7
Compare
c7c043e
to
d2f9639
Compare
019a6c7
to
95ac867
Compare
d2f9639
to
6cbb5dd
Compare
0372b92
to
768ebb6
Compare
6cbb5dd
to
06da0e2
Compare
768ebb6
to
9c63fbf
Compare
06da0e2
to
edf26c5
Compare
9c63fbf
to
c26e98f
Compare
edf26c5
to
1ae6489
Compare
c26e98f
to
8a4f9c3
Compare
1ae6489
to
aae11db
Compare
8a4f9c3
to
87aa137
Compare
aae11db
to
207bfed
Compare
87aa137
to
929d518
Compare
207bfed
to
bc972e1
Compare
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 after rebasing and minor comment changes.
c8298cb
to
040a1ef
Compare
1c77128
to
bf16949
Compare
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 after a rebase.
040a1ef
to
bd6aba6
Compare
This reverts commit 4d78ec3.
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Co-authored-by: Matthew Michel <106704043+mmichel11@users.noreply.github.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
bf16949
to
b2956f9
Compare
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
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
This PR changes the unique family of scan-like APIs to use reduce_then_scan when it is beneficial.
This PR allows us to remove
__pattern_scan_copy
functions because they are no longer used.We have moved the algorithm decisions to go through at the level of
__parallel_[copy_if/partition/unique]_copy
, so we no longer need the "scan_copy" at the pattern level.Moves all algorithm selection decisions to
__parallel_unique_copy
, and unifies range API to also use this function. This allows us to unify the algorithmic selection, and provide performance improvements to the ranges API.Unique requires some
constexpr
special casing in the kernel to allow us to avoid an extra branch for each element in the_GenMask
for unique to avoid underflow whenindex == 0
. We special case the kernels to skip and always copy the 0th element for unique family APIs, and start the scan at element1
. This allows us to handle this copy of the 0th element without any additional kernel launches. Then==1
case is handled specially with a simple copy call.This PR is targeted to #1764, to allow for a clean diff, and is a part of the following sequence of PRs meant to be merged in order:
#1769 [MERGED]
Relocate __lazy_ctor_storage to utils header#1770 [MERGED]
Use __result_and_scratch_storage within scan kernels#1762 Add reduce_then_scan algorithm for transform scan family
#1763 Make Copy_if family of APIs use reduce_then_scan algorithm
#1764 Make Partition family of APIs use reduce_then_scan algorithm
#1765 Make Unique family of APIs use reduce_then_scan algorithm (This PR)
This work is a collaboration between @mmichel11 @adamfidel and @danhoeflinger, and based upon an original prototype by Ted Painter.