-
Notifications
You must be signed in to change notification settings - Fork 73
Add static constexpr members dimensions, access_mode and access_target to accessor class spec #656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
keryell
left a comment
There was a problem hiding this 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.
|
For |
gmlueck
left a comment
There was a problem hiding this 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:
host_accessor(section 4.7.6.10)local_accessor(section 4.7.6.11)unsampled_image_accessorandhost_unsampled_image_accessor(section 4.7.6.13)sampled_image_accessorandhost_sampled_image_accessor(section 4.7.6.14)
And also in these deprecated accessor specializations:
- The
target::constant_bufferspecialization (section 4.7.6.9.4.5) - The
target::host_bufferspecialization (section 4.7.6.9.4.6) - The
target::localspecialization (section 4.7.6.9.4.7)
| class accessor { | ||
| public: | ||
| static constexpr int dimensions = Dimensions; | ||
| static constexpr sycl::access_mode access_mode = AccessMode; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
@lbushi25 - are you able to sign the CLA for this contribution? |
Done, thanks for the reminder! |
|
The WG discussed this. Next steps: add these to the other accessors types. |
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. |
|
Thanks, @lbushi25, those changes look good.
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:
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? |
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.