[cfe-dev] Clang and OpenCL address spaces

Anton Lokhmotov Anton.Lokhmotov at arm.com
Tue Oct 19 09:39:48 PDT 2010


Hi Peter,

> From my understanding of the OpenCL specification, setting the address
> space on an automatic variable is supposed to not only change the
> address space but also make the variable static (as the term is defined
> in standard C).  Adding 'static' to the qualifier macro definitions
> won't work too well because the qualifiers can also appear in other
> places.

First, I'm not sure whether 'static' is completely appropriate here:
lifetime of __local variables is limited to lifetime of a single workgroup
(unlike 'static' variables in C with the program's lifetime).  Second, I
suspect that using the address space attribute is insufficient but need to
investigate a bit more.  Third, the OpenCL spec is imprecise in a number of
points concerning address space qualifiers, which I would like to clarify
with Khronos.  For starters, can you declare __global variables in
functions?

Best, Anton.





More information about the cfe-dev mailing list