[Libclc-dev] Using clang + libclc to compile OpenCL kernels to ptx23
Jeroen Ketema via Libclc-dev
libclc-dev at lists.llvm.org
Mon Aug 24 15:39:55 PDT 2015
Hi Alex,
I think this question might be more appropriate for the cfe-dev list, but to answer your question: looking at lib/Target/NVPTX/NVPTX.td and its history, it seems that the llvm NVPTX backend at present (llvm trunk) only supports ptx32 and up, and never supported anything below ptx30.
Jeroen
> On 24 Aug 2015, at 23:24, Alex Breslow via Libclc-dev <libclc-dev at lists.llvm.org> wrote:
>
> Hi there,
>
> I'm using clang to compile OpenCL kernels to PTX so that they can be run on an architectural simulator. The simulator is only compatible with ptx23 not ptx30 or ptx31.
>
> I'm compiling the kernels as follows:
> SRC=VectorAdd.cl
> DEST=VectorAdd.ptx
>
> clang -Dcl_clang_storage_class_specifiers -isystem libclc/generic/include -include clc/clc.h -target nvptx-unknown-nvcl -xcl $SRC -emit-llvm -S -o $DEST.ll
>
> opt -S -O3 -loop-unroll $DEST.ll -o $DEST.opt.ll
>
> llc -mcpu=sm_20 -mattr=+ptx30 $DEST.opt.ll -o $DEST"
>
> The following code works to compile the kernel to ptx30, but when I attempt to change -mattr=+ptx30 to -mattr=+ptx23, I get the following warning:
>
> '+ptx23' is not a recognized feature for this target (ignoring feature)
> '+ptx23' is not a recognized feature for this target (ignoring feature)
>
> Is there a way to around this warning so that ptx23 code is generated?
>
> I am using the Ubuntu 14.04 aptitude packages for libclc-dev, libclc-ptx, clang, and llvm.
> Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
>
>
> Thanks again for your time and let me know if you need further information.
>
> Regards,
> Alex
>
> --
> Alex Breslow
>
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libclc-dev/attachments/20150824/0a8cac6f/attachment.html>
More information about the Libclc-dev
mailing list