-
Notifications
You must be signed in to change notification settings - Fork 115
Refactoring of __parallel_set_union_op
#2457
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
base: main
Are you sure you want to change the base?
Refactoring of __parallel_set_union_op
#2457
Conversation
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.
Pull Request Overview
This PR refactors the __parallel_set_union_op function by extracting common optimization logic into a new __copy_union_when_disjointed function and introducing a _SumSize helper struct. The refactoring improves code reusability between set union and set symmetric difference operations.
- Extracted optimization logic for handling disjoint sequences into
__copy_union_when_disjointed - Added
_SumSizestruct to encapsulate size calculation logic - Updated both
__pattern_set_unionand__pattern_set_symmetric_differenceto use the new shared optimization function
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| include/oneapi/dpl/pstl/algorithm_impl.h | Refactored __parallel_set_union_op into __copy_union_when_disjointed, added _SumSize struct, and updated set operation patterns to use the new shared logic |
| include/oneapi/dpl/pstl/algorithm_ranges_impl.h | Updated ranges-based set union and symmetric difference patterns to use the new shared optimization function and added necessary type aliases |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
13d8eb5 to
c66bb42
Compare
c66bb42 to
aece43f
Compare
…n_disjointed() function
…et_union : replace __parallel_set_union_op call by __copy_union_when_disjointed + __parallel_set_op calls
…et_symmetric_difference : replace __parallel_set_union_op call by __copy_union_when_disjointed + __parallel_set_op calls
…ttern_set_union : replace __parallel_set_union_op call by __copy_union_when_disjointed + __parallel_set_op calls
…ttern_set_symmetric_difference : replace __parallel_set_union_op call by __copy_union_when_disjointed + __parallel_set_op calls
…n_op as unused anymore
aece43f to
e84fb45
Compare
This PR refactors the
__parallel_set_union_opfunction by extracting common optimization logic into a new__copy_union_when_disjointedfunction and introducing a_SumSizehelper struct. The refactoring improves code reusability between set union and set symmetric difference operations.__copy_union_when_disjointed_SumSizestruct to encapsulate size calculation logic__pattern_set_unionand__pattern_set_symmetric_differenceto use the new shared optimization function