-
Notifications
You must be signed in to change notification settings - Fork 116
Refactor __get_sycl_range to align with sycl #2519
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?
Conversation
* separated no_init from write * remove unnecessary type specification Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
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 __get_sycl_range to align with SYCL runtime semantics for the write access mode. The primary change introduces a _NoInit template parameter to control copy-in behavior, making write mode perform copy-in by default (SYCL-compliant) unless explicitly suppressed.
Key Changes:
- Added
_NoInittemplate parameter to__get_sycl_rangeto control copy-in behavior forwriteaccess mode - Updated
transform_ifpatterns to use properwriteaccess mode instead ofread_writeworkaround - Fixed histogram pattern to use
read_write + no_initinstead ofwriteworkaround
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
utils_ranges_sycl.h |
Core implementation: added _NoInit parameter, removed unused _Iterator parameter, updated __is_copy_direct_v logic |
algorithm_impl_hetero.h |
Updated all callsites to remove _Iterator parameter; added /*_NoInit=*/true to preserve existing behavior for write mode; fixed transform_if patterns |
numeric_impl_hetero.h |
Updated callsites to remove _Iterator parameter and add /*_NoInit=*/true for write mode |
histogram_impl_hetero.h |
Fixed histogram to use read_write + no_init instead of write workaround; removed _Iterator parameter from callsites |
parallel_backend_sycl.h |
Updated set operation temporary buffers with /*_NoInit=*/true; removed _Iterator parameter |
binary_search_impl.h |
Removed unused _Iterator template parameter from all __get_sycl_range calls |
async_impl_hetero.h |
Updated async operations with /*_NoInit=*/true for write mode |
glue_async_impl.h |
Removed _Iterator parameter from sort_async |
single_pass_scan.h |
Updated scan kernel template with /*_NoInit=*/true |
esimd_radix_sort_dispatchers.h |
Removed _Iterator parameter from radix sort dispatcher |
esimd_radix_sort.h |
Removed _Iterator parameter from all radix sort variants |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Align
__get_sycl_rangewith SYCL runtime behavior forwriteaccess modeFixes #1272
Summary
This PR aligns
__get_sycl_range's handling of thewriteaccess mode with SYCL runtime semantics by:no_initproperty to control copy-in behaviorwritemode perform copy-in by default (SYCL-compliant)transform_ifpatterns to use proper access modes instead of workarounds_Iteratortemplate parameter from__get_sycl_rangeChanges
Core Implementation
bool _NoInit = falsetemplate parameter to__get_sycl_range__is_copy_direct_vto makewritemode copy-in by default unlessno_initis specifiedwriteimplies copy-in unless suppressed withno_initPreserved Existing Behavior (No Functional Changes)
Updated all existing
writemode callsites to use/*_NoInit=*/true, preserving their current no-copy-in behavior:algorithm_impl_hetero.h: 8 callsites (copy_if, partition_copy, unique_copy, merge, reverse_copy, rotate_copy, setoperations)
numeric_impl_hetero.h: 3 callsites (transform_scan variants, adjacent_difference)async_impl_hetero.h: 2 callsites (async operations)parallel_backend_sycl.h: 3 callsites (set operation temporary buffers)single_pass_scan.h: 1 callsite (kernel template)Fixed transform_if Workarounds
Changed
__pattern_walk2_transform_ifand__pattern_walk3_transform_iffrom usingread_write(workaround) towrite(without
no_init):Fixed Histogram Pattern
Changed histogram implementation from
writeworkaround to properread_write + no_init:Cleanup
_Iteratortemplate parameter from__get_sycl_range(noted in TODO)Bonus Bug Fix