Sycl improve code coverage multi ptr#22112
Open
dklochkov-emb wants to merge 8 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands SYCL multi_ptr validation by adding a dedicated unit-test suite plus new compile-only and e2e tests, and fixes multi_ptr’s legacy local_accessor constructor availability to match the SYCL 2020 spec’s address-space restrictions.
Changes:
- Add new
sycl/unittests/multi_ptrtest suite covering constructors, operators, conversions (includingvoidspecialization), and accessor-related construction. - Add compile-only negative/restricted conversion coverage (
-verify) and an e2e test exercisingmulti_ptr::prefetch. - Restrict the legacy
multi_ptr(local_accessor<...>)constructor to only participate forlocal_space/generic_space.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| sycl/include/sycl/multi_ptr.hpp | Restricts legacy local_accessor constructor via SFINAE to local/generic spaces. |
| sycl/unittests/CMakeLists.txt | Adds the new multi_ptr unit-test subdirectory to the SYCL unit tests build. |
| sycl/unittests/multi_ptr/CMakeLists.txt | Defines the new MultiPtrTests unit-test target and sources. |
| sycl/unittests/multi_ptr/Constructors.cpp | Unit tests for multi_ptr construction and converting construction. |
| sycl/unittests/multi_ptr/Operators.cpp | Unit tests for pointer-like operators and comparisons. |
| sycl/unittests/multi_ptr/Conversion.cpp | Unit tests for cross-decoration, void, const, and address-space conversion behavior. |
| sycl/unittests/multi_ptr/Accessors.cpp | Unit tests for construction from accessors/local_accessors and address_space_cast. |
| sycl/unittests/multi_ptr/NegativeConversions.cpp | Unit tests asserting conversions are rejected where required. |
| sycl/unittests/multi_ptr/VoidSpecialization.cpp | Unit tests focused on multi_ptr<void> / multi_ptr<const void> behavior. |
| sycl/test/multi_ptr/restricted_conversions.cpp | -verify test for diagnostics/warnings around restricted conversions. |
| sycl/test-e2e/multi_ptr/prefetch.cpp | E2E test for multi_ptr::prefetch in several scenarios. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…overage-multi-ptr
….com/dklochkov-emb/llvm into sycl-improve-code-coverage-multi-ptr
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 PR adds unit and e2e tests to check multi_ptr class. One bug is fixed: sycl 2020 specification tells that constructor
multi_ptr(local_accessor<ElementType, dimensions> Accessor)should be available only in ifAvailable only when: (Space == access::address_space::local_space || Space == access::address_space::generic_space) && (std::is_void_v || std::is_same_v<std::remove_const_t, std::remove_const_t>) && (std::is_const_v || !std::is_const_v).
See 4.7.7.1 of the sycl 2020 spec.