[Libclc-dev] Using clang + libclc to compile OpenCL kernels to ptx23

Alex Breslow via Libclc-dev libclc-dev at lists.llvm.org
Mon Aug 24 15:24:55 PDT 2015


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libclc-dev/attachments/20150824/749d2e7b/attachment-0001.html>


More information about the Libclc-dev mailing list