Add proper bounded output support to set-algorithms from oneapi::dpl::ranges namespace with CPU policies#2569
Add proper bounded output support to set-algorithms from oneapi::dpl::ranges namespace with CPU policies#2569SergeyKopienko wants to merge 727 commits intomainfrom
oneapi::dpl::ranges namespace with CPU policies#2569Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for bounded output ranges in range-based set algorithms (set_union, set_intersection, set_difference, set_symmetric_difference) and enables host policy execution for these algorithms. The changes include:
Changes:
- Implements bounded output range handling for set algorithms to properly truncate results when output capacity is insufficient
- Adds parallel execution policy support (par, unseq, par_unseq) for range-based set algorithms
- Removes libc++ workaround macro that was addressing a now-resolved bug
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/support/utils.h | Adds logging utilities and SetDataItem structure for set algorithm testing |
| test/support/test_config.h | Removes _PSTL_LIBCPP_RANGE_SET_BROKEN macro workaround |
| test/parallel_api/ranges/std_ranges_test.h | Adds bounded output testing infrastructure with padding validation |
| test/parallel_api/ranges/std_ranges_set_union.pass.cpp | Updates tests to use bounded checkers and removes workaround checks |
| test/parallel_api/ranges/std_ranges_set_symmetric_difference.pass.cpp | Updates tests with bounded output support and custom checker implementation |
| test/parallel_api/ranges/std_ranges_set_intersection.pass.cpp | Updates tests with bounded checker and removes workaround dependencies |
| test/parallel_api/ranges/std_ranges_set_difference.pass.cpp | Adds bounded output handling and custom checker |
| test/general/implementation_details/test_set_op_details.pass.cpp | New comprehensive test file for set operation implementation details |
| include/oneapi/dpl/pstl/utils_ranges.h | Adds helper functions to extract range bounds |
| include/oneapi/dpl/pstl/parallel_backend_utils.h | Implements mask-based tracking and bounded output support for parallel set operations |
| include/oneapi/dpl/pstl/algorithm_ranges_impl.h | Implements serial bounded versions and parallel support for all range-based set algorithms |
| include/oneapi/dpl/pstl/algorithm_impl.h | Major refactoring of parallel set operations to support bounded outputs with mask tracking |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/general/implementation_details/test_set_op_details.pass.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7611a17 to
48e8b25
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/parallel_api/ranges/std_ranges_set_symmetric_difference.pass.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fac271b to
c2d06d9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/general/implementation_details/test_set_op_details.pass.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
oneapi::dpl::ranges::set_union, oneapi::dpl::ranges::set_difference, oneapi::dpl::ranges::set_symmetric_difference and , oneapi::dpl::ranges::set_intersection with CPU policies
b177063 to
3ff4c96
Compare
…et_op + __parallel_tag<_IsVector>
…t_union + __parallel_tag<_IsVector>
…t_intersection + __parallel_tag<_IsVector>
…t_difference + __parallel_tag<_IsVector>
…t_symmetric_difference + __parallel_tag<_IsVector>
…ProcessingOffsets -> _SrcDataProcessingOffsets
…l::get_source_data_offsets_part() -> get_src_offsets_part()
…dPosEvaluator::OutputSizeReachedInfo::__source_data_offsets_part to __src_offsets_part
bf30e36 to
dda021c
Compare
…ce test_set_difference_checker() function to check and demonstrate current oneapi::dpl::ranges::set_difference logic
…duce test_set_intersection_checker() function to check and demonstrate current oneapi::dpl::ranges::set_intersection logic
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…oneapi::dpl::ranges::set_difference and oneapi::dpl::ranges::set_intersection
# Conflicts: # include/oneapi/dpl/pstl/algorithm_impl.h
…ienko/serial-set_fresh_to_dev
# Conflicts: # test/parallel_api/ranges/std_ranges_test.h # test/support/test_config.h
…e extra TODO from __pattern_set_intersection + __hetero_tag<_BackendTag>
This PR adds support for bounded output ranges in range-based set algorithms for the
seq,par,unseqandpar_unseqexecution policies:oneapi::dpl::ranges::set_union;oneapi::dpl::ranges::set_difference;oneapi::dpl::ranges::set_symmetric_difference;oneapi::dpl::ranges::set_intersection.Required behavior of these algorithms described at:
Changes:
_PSTL_LIBCPP_RANGE_SET_BROKENworkaround macro that was addressing a now-resolved bug: this is correct because now we have our own serial implementations for range-based set algorithms and our own checkers in tests.The main idea
std::uint8_ttype: the size of this buffer is equal to the sum of both input range sizes;__set_union_construct,__set_intersection_construct,__set_difference_constructand__set_symmetric_difference_constructwe fill this mask:range1and in therange2by calculate prefix sum in these masks and than processing data on the position corresponded with the output range size.(this idea was designed together with @akukanov)
STD_RANGES_SET_INTERSECTION_BROKEN_FOR_HETERO_POLICYbroken test macro to avoid test forstd::ranges::set_intersectionwith hetero policy due the proper logic not implemented for this algorithm for now.