Skip to content

Commit 3e04b44

Browse files
committed
Address my remaining review comments
@mkinsner told me he agrees with these comments and asked me to make them myself.
1 parent 82122bf commit 3e04b44

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

sycl/doc/extensions/DeviceGlobal/SYCL_INTEL_device_global.asciidoc

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ namespace sycl::ext::oneapi {
210210
211211
template <typename T, typename PropertyListT = property_list<>>
212212
class device_global {
213+
using subscript_return_t =
214+
std::remove_reference_t<decltype(std::declval<T>()[std::ptrdiff_t{}])>;
215+
213216
public:
214217
using element_type = std::remove_extent_t<T>;
215218
@@ -231,9 +234,12 @@ public:
231234
device_global &operator=(const device_global &&) = delete;
232235
233236
template <access::decorated IsDecorated>
234-
multi_ptr<T, access::address_space::global_space, IsDecorated> get_multi_ptr() noexcept;
237+
multi_ptr<T, access::address_space::global_space, IsDecorated>
238+
get_multi_ptr() noexcept;
239+
235240
template <access::decorated IsDecorated>
236-
multi_ptr<const T, access::address_space::global_space, IsDecorated> get_multi_ptr() const noexcept;
241+
multi_ptr<const T, access::address_space::global_space, IsDecorated>
242+
get_multi_ptr() const noexcept;
237243
238244
// Access the underlying data
239245
operator T&() noexcept;
@@ -246,7 +252,6 @@ public:
246252
device_global& operator=(const T&) noexcept;
247253
248254
// Available if the operator[] is valid for objects of type T
249-
using subscript_return_t = std::remove_reference_t<decltype(std::declval<T>()[std::ptrdiff_t{}])>;
250255
subscript_return_t& operator[]( std::ptrdiff_t idx ) noexcept;
251256
const subscript_return_t& operator[]( std::ptrdiff_t idx ) const noexcept;
252257
@@ -266,7 +271,7 @@ public:
266271
// The return type is an unspecified internal class used to represent
267272
// instances of propertyT
268273
template<typename propertyT>
269-
static constexpr auto get_property();
274+
static constexpr /*unspecified*/ get_property();
270275
};
271276
272277
} // namespace sycl::ext::oneapi
@@ -294,9 +299,12 @@ a|
294299
[source,c++]
295300
----
296301
template <access::decorated IsDecorated>
297-
multi_ptr<T, access::address_space::global_space, IsDecorated> get_multi_ptr() noexcept;
302+
multi_ptr<T, access::address_space::global_space, IsDecorated>
303+
get_multi_ptr() noexcept;
304+
298305
template <access::decorated IsDecorated>
299-
multi_ptr<T, access::address_space::global_space, IsDecorated> get_multi_ptr() const noexcept;
306+
multi_ptr<T, access::address_space::global_space, IsDecorated>
307+
get_multi_ptr() const noexcept;
300308
301309
----
302310
|
@@ -402,7 +410,7 @@ following point in Section 5.4 "Language restrictions for device functions". Th
402410
of type `device_global` in which case it can be odr-used inside a device function without being
403411
`const`/`constexpr` or zero-/constant-initialized.
404412
** Amongst other things, this restriction makes it illegal for a device function to access a
405-
global variable that isnt `const` or `constexpr` unless the variable is of type `device_global`.
413+
global variable that isn't `const` or `constexpr` unless the variable is of type `device_global`.
406414

407415

408416
=== Add new copy and memcpy members to the queue class

0 commit comments

Comments
 (0)