Skip to content

usm_allocator clarifications on equality & corectness improvements - #1090

Open
Robertkq wants to merge 3 commits into
KhronosGroup:mainfrom
Robertkq:Robertkq/usm_allocator_improvements
Open

Robertkq wants to merge 3 commits into
KhronosGroup:mainfrom
Robertkq:Robertkq/usm_allocator_improvements

Conversation

@Robertkq

@Robertkq Robertkq commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

This PR improves the synopsis, wording and code of the usm_allocator section. It follows up on issue #1088, but goes a bit further:

  1. Removes the Alignment template parameter from equality comparison
  2. Adds new prose for equality comparison that follows the standard C++ allocator definition more closely
  3. Adds noexcept explicitly to the move assignment operator
  4. Adds the get_property/has_property functions to the synopsis

It is accompanied by the following SYCL-CTS PR

Closes #1088

Assisted by Claude

@Robertkq

Copy link
Copy Markdown
Contributor Author

Open question: deallocate only needs the context, so under the C++ definition AllocKind and the device could also be removed from equality. I kept them for now to keep this change minimal, and can follow up if there is agreement.

Comment on lines +11490 to +11491

template <typename Property> Property get_property() const;

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.

Suggested change
template <typename Property> Property get_property() const;
template <typename Property> Property get_property() const;

Nit: I think the formatting looks better with no blank line here. I think the formatting pattern is that when a "block" of functions each fit on a single line, there is no need to separate them with a blank line. For example, see the way the constructor overloads are formatted above.

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.

sycl::usm_allocator equality comparison clarification

2 participants