Skip to content

SYCL test: add compile-time conformance checks for group/sub_group comparison operators - #22984

Draft
mianowski with Copilot wants to merge 2 commits into
syclfrom
copilot/fix-code-review-comment-22888
Draft

SYCL test: add compile-time conformance checks for group/sub_group comparison operators#22984
mianowski with Copilot wants to merge 2 commits into
syclfrom
copilot/fix-code-review-comment-22888

Conversation

Copilot AI commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

This addresses the linked review feedback by adding compile-time coverage for SYCL 2020 comparison-operator requirements that were not validated in group.cpp. The change is scoped to the single requested comment.

  • What was missing

    • sycl/test/basic_tests/group.cpp only validated host runtime behavior for get_local_id / get_local_linear_id.
    • It did not assert API-shape guarantees for group / sub_group equality operators.
  • What changed

    • Added compile-time traits and static_asserts for sycl::group<1> and sycl::sub_group to verify:
      • no member operator== / operator!= (hidden-friend style),
      • comparison expressions return bool,
      • comparison expressions are noexcept.
  • Example of added coverage

    static_assert(!has_member_equal<Group>::value);
    static_assert(std::is_same_v<decltype(std::declval<const Group &>() ==
                                          std::declval<const Group &>()),
                                 bool>);
    static_assert(noexcept(std::declval<const Group &>() ==
                           std::declval<const Group &>()));

Co-authored-by: mianowski <8652524+mianowski@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code as suggested in review comment SYCL test: add compile-time conformance checks for group/sub_group comparison operators Aug 20, 2026
Copilot AI requested a review from mianowski August 20, 2026 13:45
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