Skip to content

Conversation

@SergeyKopienko
Copy link
Contributor

@SergeyKopienko SergeyKopienko commented Sep 16, 2025

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 _SumSize struct to encapsulate size calculation logic
  • Updated both __pattern_set_union and __pattern_set_symmetric_difference to use the new shared optimization function

Copy link
Contributor

Copilot AI left a 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 _SumSize struct to encapsulate size calculation logic
  • Updated both __pattern_set_union and __pattern_set_symmetric_difference to 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.

@SergeyKopienko SergeyKopienko force-pushed the dev/skopienko/refactoring_of_parallel_set_union_op branch 7 times, most recently from 13d8eb5 to c66bb42 Compare September 23, 2025 12:31
@SergeyKopienko SergeyKopienko force-pushed the dev/skopienko/refactoring_of_parallel_set_union_op branch from c66bb42 to aece43f Compare September 24, 2025 09:37
…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
@SergeyKopienko SergeyKopienko force-pushed the dev/skopienko/refactoring_of_parallel_set_union_op branch from aece43f to e84fb45 Compare September 24, 2025 10:47
@SergeyKopienko SergeyKopienko modified the milestones: 2022.11.0, 2022.12.0 Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant