Skip to content

Commit

Permalink
Fix prvalue to xvalue conversion address space assignment
Browse files Browse the repository at this point in the history
The common address deduction rules assumed prvalue-to-xvalue conversion
can only happens inside a function.
The patch aligns the rules to match declaration rules.
  • Loading branch information
Naghasan committed Sep 21, 2023
1 parent e63b8b7 commit ebfbd65
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions adoc/chapters/device_compiler.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ 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
** If the type is [code]#const#, the address space of the declaration is assigned to
is implementation-defined. 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 @@ -748,9 +748,11 @@ 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 in a block scope or function parameter scope,
the result is assigned to the local address space if it happens 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 ebfbd65

Please sign in to comment.