Skip to content

Sycl improve code coverage multi ptr#22112

Open
dklochkov-emb wants to merge 8 commits into
intel:syclfrom
dklochkov-emb:sycl-improve-code-coverage-multi-ptr
Open

Sycl improve code coverage multi ptr#22112
dklochkov-emb wants to merge 8 commits into
intel:syclfrom
dklochkov-emb:sycl-improve-code-coverage-multi-ptr

Conversation

@dklochkov-emb
Copy link
Copy Markdown
Contributor

@dklochkov-emb dklochkov-emb commented May 25, 2026

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 if

Available 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.

Copy link
Copy Markdown
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 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_ptr test suite covering constructors, operators, conversions (including void specialization), and accessor-related construction.
  • Add compile-only negative/restricted conversion coverage (-verify) and an e2e test exercising multi_ptr::prefetch.
  • Restrict the legacy multi_ptr(local_accessor<...>) constructor to only participate for local_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.

Comment thread sycl/unittests/multi_ptr/Accessors.cpp Outdated
Comment thread sycl/unittests/multi_ptr/NegativeConversions.cpp Outdated
Comment thread sycl/unittests/multi_ptr/NegativeConversions.cpp
Comment thread sycl/unittests/multi_ptr/NegativeConversions.cpp Outdated
Comment thread sycl/test-e2e/multi_ptr/prefetch.cpp Outdated
Comment thread sycl/test-e2e/multi_ptr/prefetch.cpp Outdated
Comment thread sycl/test-e2e/multi_ptr/prefetch.cpp
Comment thread sycl/test-e2e/multi_ptr/prefetch.cpp Outdated
Comment thread sycl/unittests/multi_ptr/VoidSpecialization.cpp Outdated
Comment thread sycl/unittests/multi_ptr/VoidSpecialization.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants