Uninitialized refactors#2549
Conversation
|
This PR is a follow up to #2519 so lets land that first. Thanks for the approval. |
6788a87 to
ac2143a
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors uninitialized memory operations in oneDPL to improve code clarity and correctness. It removes the redundant fill_functor wrapper struct, introduces specialized __pattern_uninitialized_walk1 functions with proper SYCL access modes (write with _NoInit=false), and eliminates unnecessary wrapper functions __pattern_walk_brick and __pattern_walk_brick_n.
Key changes:
- Removed
fill_functorstruct and replaced its usage with direct__brick_fillcalls - Added
__pattern_uninitialized_walk1and__pattern_uninitialized_walk1_nfunctions that use correct SYCL access modes for uninitialized memory operations - Updated all uninitialized memory APIs (
uninitialized_fill,uninitialized_value_construct,uninitialized_default_construct, and their_nvariants) to use the new pattern functions
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| include/oneapi/dpl/pstl/hetero/algorithm_impl_hetero.h | Removed fill_functor struct and __pattern_walk_brick* functions; added __pattern_uninitialized_walk1* functions; updated __pattern_fill to use __brick_fill directly |
| include/oneapi/dpl/pstl/algorithm_impl.h | Removed __pattern_walk_brick* implementations; added __pattern_uninitialized_walk1* wrappers |
| include/oneapi/dpl/pstl/algorithm_fwd.h | Updated forward declarations to replace __pattern_walk_brick* with __pattern_uninitialized_walk1* |
| include/oneapi/dpl/pstl/glue_memory_impl.h | Updated uninitialized memory APIs to use __pattern_uninitialized_walk1* and __pattern_fill* |
| include/oneapi/dpl/pstl/memory_ranges_impl.h | Updated ranges-based uninitialized APIs to use new pattern functions |
| include/oneapi/dpl/pstl/hetero/histogram_impl_hetero.h | Replaced fill_functor with __brick_fill |
| include/oneapi/dpl/internal/async_impl/async_impl_hetero.h | Replaced fill_functor with __brick_fill |
| test/general/implementation_details/device_copyable.pass.cpp | Removed fill_functor device copyability tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
36ae926 to
03c83d1
Compare
03c83d1 to
08eb860
Compare
|
I see you have some conflicts between the branches |
08eb860 to
f02042d
Compare
Fixed, this was due to the pulling out of fill access mode changes into #2555 |
f02042d to
e029ce4
Compare
|
I had to resolve some conflicts with the previous branch. Also, this needs to wait for #2519 to merge, so please review that if you want these changes in. |
af1999d to
c817512
Compare
The base branch was changed.
e029ce4 to
46ff098
Compare
|
@SergeyKopienko @MikeDvorskiy I've now rebased this after merging #2519. CI looks to be in good shape. Please take another look. |
fix access modes for uninitialized apis remove unnecessary pattern 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>
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>
Co-authored-by: Alexey Kukanov <alexey.kukanov@intel.com>
0b61bcf to
0a56ec7
Compare
MikeDvorskiy
left a comment
There was a problem hiding this comment.
Left a comment about _IsNoInitRequested
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
The indicated issues have been addressed.
Co-authored-by: Alexey Kukanov <alexey.kukanov@intel.com>
This commit refactors fill operations and corrects access modes for uninitialized memory APIs in oneDPL.
1. Removed Redundant Fill Functor
fill_functorstruct that was wrapping a simple assignment operation__pattern_fillto directly use__brick_fillinstead, simplifying the implementation2. Fixed Access Modes for Uninitialized APIs
__pattern_uninitialized_walk1and__pattern_uninitialized_walk1_nfunctions that properly usesycl::access_mode::writewith_NoInit=falseuninitialized_fill/uninitialized_fill_nuninitialized_default_construct/uninitialized_default_construct_nuninitialized_value_construct/uninitialized_value_construct_n3. Removed Unnecessary Pattern Functions
__pattern_walk_brickand__pattern_walk_brick_nwrappers that were no longer needed