[Reduce_then_scan refactor pt 1] Relaxing requirement of trivial copyable types#2656
Draft
danhoeflinger wants to merge 33 commits intomainfrom
Draft
[Reduce_then_scan refactor pt 1] Relaxing requirement of trivial copyable types#2656danhoeflinger wants to merge 33 commits intomainfrom
danhoeflinger wants to merge 33 commits intomainfrom
Conversation
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>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
This reverts commit caae9c5.
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>
This reverts commit aa77e30.
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>
This reverts commit 4ed4c17.
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>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the SYCL reduce-then-scan implementation to support non-trivially-copyable value types by introducing SLM/barrier-based sub-group communication fallbacks, and updates related generator types/traits to use explicit return types for better type control.
Changes:
- Adds SLM/barrier-based fallback implementations for sub-group communication primitives used by reduce-then-scan.
- Removes the “trivially copyable” restriction in dispatch logic so reduce-then-scan can be selected for more value types.
- Adds explicit return-type template parameters to several generator types and updates associated device-copyable trait specializations and tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/general/implementation_details/device_copyable.pass.cpp | Updates static-asserts for new generator template parameters (explicit return types). |
| test/general/implementation_details/balanced_path_unit_tests.pass.cpp | Updates balanced-path generator instantiation to include explicit return type. |
| include/oneapi/dpl/pstl/hetero/dpcpp/sycl_traits.h | Updates forward declarations and sycl::is_device_copyable specializations for new generator signatures. |
| include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl.h | Removes trivially-copyable gating for reduce-then-scan selection in scan/segmented paths. |
| include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_reduce_then_scan.h | Implements SLM-based sub-group communication fallbacks and refactors kernels to branch once per kernel body. |
| include/oneapi/dpl/experimental/kt/internal/work_group/work_group_scan.h | Updates calls into the shared sub-group scan primitives to match new signatures. |
| include/oneapi/dpl/experimental/kt/internal/sub_group/sub_group_scan.h | Updates calls into the shared sub-group scan primitives to match new signatures. |
| include/oneapi/dpl/experimental/kt/internal/cooperative_lookback.h | Updates calls into the shared sub-group scan primitives to match new signatures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request relaxes the requirement of trivially copyable value types for reduce_then_scan, taking the first step toward enabling it for all cases.
__group_broadcastand__shift_group_right. This requires extra SLM data to be allocated and passed.__gen_count_mask,__gen_expand_count_mask,__gen_set_balanced_path,__gen_set_op_from_known_balanced_pathto correct intermediate type to be better controlled and resolve ambiguity with SLM pointer type.Full picture: