Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the set_intersection parallel algorithm to improve efficiency by selecting the optimal trimming strategy (which minimizes total data) and parallelizing along the larger range dimension. The changes affect two implementation files with parallel algorithms for set intersection operations.
Changes:
- Refactored trimming strategy selection to choose the strategy that trims more elements
- Changed parallelization decision to always partition the larger range after trimming
- Changed variable types from
autoto explicitstd::size_tfor size calculations - Simplified cutoff logic to check total work after applying the optimal trimming strategy
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
include/oneapi/dpl/pstl/algorithm_ranges_impl.h |
Updated __pattern_set_intersection to use improved trimming and parallelization logic for ranges-based interface; contains critical bugs in the implementation |
include/oneapi/dpl/pstl/algorithm_impl.h |
Updated __pattern_set_intersection to use improved trimming and parallelization logic for iterator-based interface; complete implementation with minor issues |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const auto __m2 = __last2 - __left_bound_seq_2 + __n1; | ||
| if (__m2 > __set_algo_cut_off) | ||
| const std::size_t __total_work = __n1 + __n2; |
There was a problem hiding this comment.
I think it is rather a common type for _DifferenceType1 and _DifferenceType2.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SergeyKopienko
left a comment
There was a problem hiding this comment.
I think make sense also to think about __set_union_construct calls too.
I created an issue, Id rather deal with them independently. |
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: Sergey Kopienko <sergey.kopienko@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>
7516458 to
2427032
Compare
Improves the
set_intersectionparallel algorithm logic to be more efficient and correct when selecting which input range to partition.Now we select the trimming strategy which minimizes the total data and always parallelize along the larger dimension.
This logic was oddly configured previously.