[cfe-dev] memory annotation treatment in the compilation of OpenCL code
alberto.magni86 at gmail.com
Tue Jan 10 11:38:54 PST 2012
try the following:
clang -ccc-host-triple ptx32 \
-Xclang -target-feature -Xclang +ptx23 \
-Xclang -target-feature -Xclang +sm20 \
-I$LIBCLC/generic/include -I$LIBCLC/ptx-nvidiacl/include \
-O0 kernels/matrixMul.cl -S -emit-llvm -o matrixMul.ll
where $LIBCLC points to the libclc  installation directory.
(This command is a modification of the one by Justin Holewinski you
can find here )
I am wondering why the frontend does not lower this piece of
information to the IR-level
when compiling for x86. I think that should be backend's
responsibility to discard the
address space if the target supports only the default one.
Am I missing something ?
2012/1/10 Pekka Jääskeläinen <pekka.jaaskelainen at tut.fi>:
> On 01/09/2012 11:18 PM, Bo Wu wrote:
>> Then I changed "__global" to "__local" and generate the IR again, but
>> the generated IR is the same as the first one.
> When compiling for x86(_64) the address spaces to global and local
> probably point to the same target address space (0) so there's no
> difference in the final IR.
>> I am confused because if the "__local" information is lost when
>> generating LLVM IR, how can local memory be used anyway?
> Please check this thread from the last March where the local
> memory implementation is discussed:
> Best regards,
> Pekka Jääskeläinen,
> a contributor to the Portable OpenCL (http://launchpad.net/pocl)
> project which uses the Clang's OpenCL C support
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
More information about the cfe-dev