-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add shorthand aliases for address spaces #633
base: main
Are you sure you want to change the base?
Conversation
Working with address spaces (e.g., when using address space casts) was previously very verbose. Defining shorthands allows long values like sycl::access::address_space::global_space to be replaced by much shorter values like sycl::global_space.
To kickstart the bikeshedding... @AerialMantis had suggested that we adopt different names here, that would be more aligned with names like One way we could split the difference between namespace sycl {
namespace access {
enum class address_space : int {
global_space,
local_space,
private_space,
generic_space
};
} // namespace access
using addrspace = access::address_space;
static constexpr addrspace addrspace_global = addrspace::global_space;
static constexpr addrspace addrspace_local = addrspace::local_space;
static constexpr addrspace addrspace_private = addrspace::private_space;
static constexpr addrspace addrspace_generic = addrspace::generic_space;
} // namespace sycl ...which would give us a shorthand of Setting a precedent for use of |
I Agree with Gordon, I would like to keep the consistency of our mangling. I personally have no problem with But I have no problem with (even if I'm still confused between |
I agree that having too many ways to do the same thing is bad. The only reason I'm suggesting to make an exception here is simply to avoid breakage between SYCL 2020 and SYCL-Next. Between SYCL 1.2.1 and SYCL 2020 we renamed |
Agree! Should we deprecate it now, so we can remove it in SYCL Next? |
We should talk about this in a WG meeting. I don't think we can deprecate things if we go the alias route. Adding I believe our options are:
|
There also a 4th option, which I'll throw out:
This would allow us to deprecate and eventually remove Many of the uses of |
I am thinking to
|
Working with address spaces (e.g., when using address space casts) was previously very verbose. Defining shorthands allows long values like
sycl::access::address_space::global_space
to be replaced by much shorter values likesycl::global_space
.