@@ -210,6 +210,9 @@ namespace sycl::ext::oneapi {
210
210
211
211
template <typename T, typename PropertyListT = property_list<>>
212
212
class device_global {
213
+ using subscript_return_t =
214
+ std::remove_reference_t<decltype(std::declval<T>()[std::ptrdiff_t{}])>;
215
+
213
216
public:
214
217
using element_type = std::remove_extent_t<T>;
215
218
@@ -231,9 +234,12 @@ public:
231
234
device_global &operator=(const device_global &&) = delete;
232
235
233
236
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
+
235
240
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;
237
243
238
244
// Access the underlying data
239
245
operator T&() noexcept;
@@ -246,7 +252,6 @@ public:
246
252
device_global& operator=(const T&) noexcept;
247
253
248
254
// 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{}])>;
250
255
subscript_return_t& operator[]( std::ptrdiff_t idx ) noexcept;
251
256
const subscript_return_t& operator[]( std::ptrdiff_t idx ) const noexcept;
252
257
@@ -266,7 +271,7 @@ public:
266
271
// The return type is an unspecified internal class used to represent
267
272
// instances of propertyT
268
273
template<typename propertyT>
269
- static constexpr auto get_property();
274
+ static constexpr /*unspecified*/ get_property();
270
275
};
271
276
272
277
} // namespace sycl::ext::oneapi
294
299
[source,c++]
295
300
----
296
301
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
+
298
305
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;
300
308
301
309
----
302
310
|
@@ -402,7 +410,7 @@ following point in Section 5.4 "Language restrictions for device functions". Th
402
410
of type `device_global` in which case it can be odr-used inside a device function without being
403
411
`const`/`constexpr` or zero-/constant-initialized.
404
412
** Amongst other things, this restriction makes it illegal for a device function to access a
405
- global variable that isn’ t `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`.
406
414
407
415
408
416
=== Add new copy and memcpy members to the queue class
0 commit comments