Skip to content

Commit aeeea11

Browse files
committed
[SYCL] Clarify why global address space is used instead of constant
Signed-off-by: Mariya Podchishchaeva <[email protected]>
1 parent 2aaa4ab commit aeeea11

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sycl/include/CL/sycl/access/access.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ struct PtrValueType<ElementType, access::address_space::global_space> {
127127

128128
template <typename ElementType>
129129
struct PtrValueType<ElementType, access::address_space::constant_space> {
130+
// Current implementation of address spaces handling leads to possibility
131+
// of emitting incorrect (in terms of OpenCL) address space casts from constant
132+
// to generic (and vise-versa). So, global address space is used here instead of
133+
// constant to avoid incorrect address space casts in the produced device code.
134+
// "const" qualifier is not used here because multi_ptr interface contains
135+
// methods which return pure ElementType without qualifiers and adding const
136+
// qualifier here will require adding const casts to multi_ptr methods to remove
137+
// const qualifiers from underlying pointer type.
130138
using type = SYCL_GLOBAL_AS ElementType;
131139
};
132140

0 commit comments

Comments
 (0)