Skip to content

Commit 323579e

Browse files
committed
Make more strict gurantees about generated global constructor
1 parent e6938d8 commit 323579e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sycl/doc/design/MappingHostAddressesToDeviceEntities.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ The function accepts the following arguments:
150150

151151
The compiler guarantees that the function will be called zero or more times
152152
(depending on the amount of uniquely identifiable objects found in a program)
153-
_before_ application's `main()` function, i.e. in a global constructor.
153+
_before_ application's `main()` function and _before_ any other global
154+
constructor defined in the same translation unit: this is needed to allow usages
155+
of `specialization_id` and `device_global` variables from user-defined global
156+
constructors.
154157

155158
That poses some restrictions on those uniquely identifiable object, i.e. that
156159
they can't be used from another global object due to risk of accessing a

0 commit comments

Comments
 (0)