Skip to content

[SYCL][SYCL2020] Add missing noexcept to ctors of public SYCL RT classes - #23184

Open
dm-vodopyanov wants to merge 1 commit into
intel:syclfrom
dm-vodopyanov:add-inline-to-some-ctors
Open

dm-vodopyanov wants to merge 1 commit into
intel:syclfrom
dm-vodopyanov:add-inline-to-some-ctors

Conversation

@dm-vodopyanov

Copy link
Copy Markdown
Contributor

This patch add missing noexcept to some of the classes in accordance with SYCL 2020 spec update above.

Note: this patch must be merged only AFTER this one:

…asses

Note: this patch must be merged AFTER this one:

- KhronosGroup/SYCL-Docs#1044

This patch add missing `noexcept` to some of the classes in accordance
with SYCL 2020 spec update above.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test cannot detect a missing move constructor when a non-throwing copy constructor accepts rvalues.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Implements a pending SYCL 2020 update requiring non-throwing move operations for public runtime classes.

Changes:

  • Marks device and buffer move constructors noexcept.
  • Adds explicit move operations to h_item.
  • Adds compile-time checks for common-semantics classes.
File summaries
File Description
sycl/include/sycl/buffer.hpp Makes buffer moves non-throwing.
sycl/include/sycl/device.hpp Updates the public device declaration.
sycl/source/device.cpp Updates the device implementation.
sycl/include/sycl/h_item.hpp Adds move constructor and assignment.
sycl/test/basic_tests/common_semantics_noexcept.cpp Tests move-operation requirements.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +19 to +20
static_assert(std::is_nothrow_move_constructible_v<__VA_ARGS__>, \
#__VA_ARGS__ " must be nothrow move constructible"); \
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