[Libclc-dev] Up to date usage example
Timothy Flynn via Libclc-dev
libclc-dev at lists.llvm.org
Thu Jun 30 03:59:26 PDT 2016
Hi,
Is there a complete example that shows how to compile and link a kernel
with the latest versions (3.9) of clang and libclc ?
After building clang and libclc the compile-test.sh script does not
appear to work on any of the kernels in the test directory. The initial
error is due to the absence of the file
nvptx--nvidiacl/lib/builtins.bc. I tried changing the command to use
builtins.opt.bc but other errors occurred.
I've seen some examples online but it isn't clear that any of them are up
to date.
This command:
clang -O3 --include /usr/local/include/clc/clc.h -I /usr/local/include/clc
-Dcl_clang_storage_class_specifiers -x cl -Xclang -mlink-bitcode-file
-Xclang /usr/local/lib/clc/tonga-amdgcn--.bc -target amdgcn--amdhsa
-mcpu=tonga -Xclang -cl-std=CL2.0 -DCL20 cos.cl -o cos.bc
fails because clang-3.9 attempts to find ld,lld (which I have not installed
since my understanding is that it shouldn't be needed for libclc).
(cos.cl is from the libclc tests directory.)
If I change the above command to produce cos.ll by adding the -S option it
works but then
llvm-link cos.ll /usr/local/lib/clc/tonga-amdgcn--amdhsa.bc -o cos-linked.bc
fails with the error:
llvm-link: output.ll:1:2: error: expected top-level entity
.text
Any help here would be appreciated.
Thanks,
Tim Flynn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libclc-dev/attachments/20160630/fd3d1896/attachment.html>
More information about the Libclc-dev
mailing list