You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL][Docs] Allow copy-construction of device_global (#15075)
This commit makes it possible to copy-construct device_global variables
if they do not have the device_image_scope property. The restriction on
device_image_scope is due to static construction not being allowed in
device code, which they would require, while other device_globals have
USM storage which will be initialized by the host code, so the
constructor on the device is a simple zero-initialization.
---------
Signed-off-by: Larsen, Steffen <[email protected]>
Co-authored-by: John Pennycook <[email protected]>
Available if `PropertyListT::has_property<device_image_scope_key>() == false`.
346
+
347
+
Constructs a `device_global` object, and implicit storage for `T` in the global address space on each device that may access it.
348
+
349
+
The storage on each device for `T` is initialized with a copy of the initial value of `other`. The behavior is undefined if `other` has been written to prior to a call to this constructor.
Available if `PropertyListT::has_property<device_image_scope_key>() == false` and
360
+
`std::is_convertible_v<OtherT, T> == true`;
361
+
362
+
Constructs a `device_global` object, and implicit storage for `T` in the global address space on each device that may access it.
363
+
364
+
The storage on each device for `T` is initialized with a copy of the initial value of `other`. The behavior is undefined if `other` has been written to prior to a call to this constructor.
0 commit comments