Skip to content

Conversation

@lbushi25
Copy link

@lbushi25 lbushi25 commented Nov 7, 2024

This PR addresses #270. It follows in the footsteps of #351.
I think this will require CTS changes as well but I can't add the label myself.

@CLAassistant
Copy link

CLAassistant commented Nov 7, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@keryell keryell left a comment

Choose a reason for hiding this comment

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

That looks like a good starting point.

@lbushi25 lbushi25 marked this pull request as ready for review November 14, 2024 06:40
@keryell keryell added this to the SYCL Next milestone Dec 5, 2024
@keryell
Copy link
Member

keryell commented Dec 5, 2024

For dimensions we could use mdspan equivalent https://en.cppreference.com/w/cpp/container/mdspan/extents/rank but unfortunately it relies on C++23 constexpr static access through this.

Copy link
Contributor

@gmlueck gmlueck left a comment

Choose a reason for hiding this comment

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

I think we should also add these static constexpr members to the other forms of accessors for consistency:

And also in these deprecated accessor specializations:

class accessor {
public:
static constexpr int dimensions = Dimensions;
static constexpr sycl::access_mode access_mode = AccessMode;
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that the sycl:: namespace is not strictly necessary here. It could be like this:

static constexpr access_mode access_mode = AccessMode;

But maybe the sycl:: is better for clarity anyway.

I was concerned at first that this definition of access_mode will shadow the type sycl::access_mode for any code inside this class. I think this will not affect the specification, though, because none of the member function parameter or return types use access_mode. Of course, implementations will likely need to change because they undoubtedly use the access_mode type in their implementations. I think that is OK, though. Raising the shadowing issue here, though, in case others see some problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if shadowing is a problem or not, but if it is then I think we already have it, because multi_ptr defines:

static constexpr access::address_space address_space = Space;

I'm just pointing that out because if we decide to do something different here, we may need to revisit multi_ptr.

@Pennycook Pennycook linked an issue May 30, 2025 that may be closed by this pull request
@tomdeakin
Copy link
Contributor

@lbushi25 - are you able to sign the CLA for this contribution?

@lbushi25
Copy link
Author

@lbushi25 - are you able to sign the CLA for this contribution?

Done, thanks for the reminder!

@tomdeakin
Copy link
Contributor

tomdeakin commented Oct 9, 2025

The WG discussed this. Next steps: add these to the other accessors types.

@lbushi25
Copy link
Author

I think we should also add these static constexpr members to the other forms of accessors for consistency:

And also in these deprecated accessor specializations:

I have added the members for other accessor types. I cannot seem to find the deprecated specialization of accessors in the second part of your comment. Since this is old, I'm assuming they have been removed already?

@lbushi25
Copy link
Author

I think we should also add these static constexpr members to the other forms of accessors for consistency:

And also in these deprecated accessor specializations:

I have added the members for other accessor types. I cannot seem to find the deprecated specialization of accessors in the second part of your comment. Since this is old, I'm assuming they have been removed already?

@gmlueck ping for awareness.

@tomdeakin tomdeakin added the CTS May require changes to CTS label Oct 29, 2025
@gmlueck
Copy link
Contributor

gmlueck commented Nov 3, 2025

Thanks, @lbushi25, those changes look good.

I have added the members for other accessor types. I cannot seem to find the deprecated specialization of accessors in the second part of your comment. Since this is old, I'm assuming they have been removed already?

They are still in the spec. Deprecated features will not ever be removed from the SYCL 2020 spec (though they may be removed in future versions of the SYCL spec). The relevant source file headers are:

  • headers/accessorDeprecatedConstant.h
  • headers/accessorDeprecatedHost.h
  • headers/accessorDeprecatedLocal.h

The WG always asks about CTS coverage before approving spec clarifications now. Do you know if we have tests that cover these member variables already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CTS May require changes to CTS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should more template arguments be propagated as members?

7 participants