Skip to content

Commit bf0a40d

Browse files
committed
Fix wording and requirements
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 6e204da commit bf0a40d

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

sycl/doc/extensions/experimental/sycl_ext_oneapi_device_global.asciidoc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ public:
232232
233233
// device_global initializes underlying T with the args argument
234234
#if __cpp_consteval
235+
// Available only if sizeof...(Args) > 1 or the one argument in args is not a
236+
// device_global.
235237
template <typename... Args>
236238
consteval explicit device_global(Args&&... args);
237239
#else
@@ -244,11 +246,11 @@ public:
244246
device_global() = default;
245247
#endif // __cpp_consteval
246248
247-
// Available if has_property<device_image_scope> is false
249+
// Available if PropertyListT::has_property<device_image_scope_key>() is false.
248250
constexpr device_global(const device_global &other);
249251
250-
// Available if has_property<device_image_scope> is false and OtherT is
251-
//convertible to T
252+
// Available if PropertyListT::has_property<device_image_scope_key>() is false
253+
// and OtherT is convertible to T.
252254
template <typename OtherT, typename OtherProps>
253255
constexpr device_global(const device_global<OtherT, OtherProps> &other) {}
254256
@@ -325,6 +327,8 @@ template <typename... Args>
325327
consteval explicit device_global(Args&&... args);
326328
----
327329
|
330+
Available only if sizeof...(Args) != 1 or the one argument in args is not a device_global.
331+
328332
Constructs a `device_global` object, and implicit storage for `T` in the global address space on each device that may access it.
329333

330334
The object of type `T` is initialized from the `args` parameter pack using list initialization as defined in the {cpp} specification.
@@ -338,14 +342,12 @@ a|
338342
constexpr device_global(const device_global &other);
339343
----
340344
|
341-
Available if `has_property<device_image_scope> == false`.
345+
Available if `PropertyListT::has_property<device_image_scope_key>() == false`.
342346

343347
Constructs a `device_global` object, and implicit storage for `T` in the global address space on each device that may access it.
344348

345349
The storage on each device for `T` is initialized with a copy of the storage in `other`.
346350

347-
`T` must be copy constructible and trivially destructible.
348-
349351
// --- ROW BREAK ---
350352
a|
351353
[source,c++]
@@ -354,13 +356,12 @@ template <typename OtherT, typename OtherProps>
354356
constexpr device_global(const device_global<OtherT, OtherProps> &other) {}
355357
----
356358
|
357-
Available if `has_property<device_image_scope> == false`.
359+
Available if `PropertyListT::has_property<device_image_scope_key>() == false` and
360+
`std::is_convertible_v<OtherT, T> == true`;
358361

359362
Constructs a `device_global` object, and implicit storage for `T` in the global address space on each device that may access it.
360363

361-
The storage on each device for `T` is initialized with a storage in `other`.
362-
363-
`OtherT` must be convertible to `T` and `T` must be trivially destructible.
364+
The storage on each device for `T` is initialized with a copy of the storage in `other`.
364365

365366
// --- ROW BREAK ---
366367
a|

0 commit comments

Comments
 (0)