Skip to content

Commit

Permalink
Add shorthand aliases for address spaces
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Pennycook committed Sep 27, 2024
1 parent df5d241 commit e567d0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions adoc/chapters/what_changed.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
* The overload with a fallback/secondary queue parameter of the
[code]#submit()# member function of [code]#sycl::queue# was deprecated.

* Added shorthand aliases for address spaces to reduce verbosity, enabling
(for example) [code]#sycl::access::address_space::global_space# to be
replaced with [code]#sycl::global_space#.

== What has changed from SYCL 1.2.1 to SYCL 2020

The SYCL runtime moved from namespace [code]#cl::sycl# provided by
Expand Down
6 changes: 6 additions & 0 deletions adoc/headers/multipointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ enum class decorated : /* unspecified */ {

} // namespace access

// Shorthand aliases for address spaces
constexpr inline access::address_space global_space = access::address_space::global_space;
constexpr inline access::address_space local_space = access::address_space::local_space;
constexpr inline access::address_space private_space = access::address_space::private_space;
constexpr inline access::address_space generic_space = access::address_space::generic_space;

template <typename T> struct remove_decoration {
using type = /* ... */;
};
Expand Down

0 comments on commit e567d0c

Please sign in to comment.