Skip to content

Commit

Permalink
Merge pull request #464 from Naghasan/prvalue-promotion-errata
Browse files Browse the repository at this point in the history
Fix prvalue to xvalue conversion address space assignment
  • Loading branch information
gmlueck authored Dec 7, 2023
2 parents 64950fb + c93258c commit 1b270b2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions adoc/chapters/device_compiler.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,8 @@ The variable declarations get assigned to an address space depending on their
scope and storage class:

* Namespace scope
** If the type is [code]#const#, the address space the declaration is assigned
to is implementation-defined.
** If the type is [code]#const#, the declaration is assigned to an
implementation-defined address space.
If the target of the SYCL backend can represent the generic address space,
then the assigned address space must be compatible with the generic address
space.
Expand All @@ -761,9 +761,14 @@ device kernel or code called by the device kernel.
** Static data members are treated the same way as for variable in namespace
scope

The result of a prvalue-to-xvalue conversion is assigned to the local address
space if it happens in a hierarchical context or to the private address space
otherwise.
If a prvalue-to-xvalue conversion happens as part of an initialization
expression, then the result is assigned to the same address space as the entity
being initialized.
Otherwise, if the conversion happens in a block scope or function parameter
scope, the result is assigned to the local address space if it happens in a
hierarchical context otherwise it is assigned to the private address space.
It the prvalue-to-xvalue conversion happens in another scope, the result is
assigned in the same way as declaration in namespace scope.


[[subsec:genericAddressSpace]]
Expand Down

0 comments on commit 1b270b2

Please sign in to comment.