[cfe-dev] openclc to llvm
lunarrocks at gmail.com
Fri Apr 27 08:19:15 PDT 2012
On Fri, Apr 27, 2012 at 7:36 PM, Peter Collingbourne <peter at pcc.me.uk>wrote:
> On Fri, Apr 27, 2012 at 11:37:13AM +0800, Lei Mou wrote:
> > Hi Ankur,
> > Yes, you need the support of libclc in order to successfully compile
> > kernels. It is available at http://libclc.llvm.org/. After building
> > you can use the script "compile-test.sh" to compile OpenCL kernels. For
> > the compile-test.sh has a little problem (due to the option -Xclang
> > ptx32--nvidiacl/lib/builtins.bc), so I just removed the option, and the
> What problem? Did you follow the instructions in README.TXT to build
> the builtins.bc file?
Thank you for your attention. I did follow the instructions in README.txt.
I got a lot of errors and warnings like the following one:
ptx32--nvidiacl/lib/builtins.bc:299:196: warning: null character ignored
2�>���M 0 !����<� �D��#>R��� hS � �>b� ODH>�#��;<F PT�5ن �T��4��#��!
!��p@�H}�e�Q ��#� �D��#>���c� HE\��� $ !���-$ �,>�#� �,>�# �T��4�d���
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2900 warnings and 20 errors generated.
I don't know what's the problem, so I just removed the option from the
> > resulting script looks like this:
> > clang -ccc-host-triple ptx32--nvidiacl -Iptx-nvidiacl/include
> > -Igeneric/include -include clc/clc.h -target-feature -Xclang +ptx23
> > -target-feature -Xclang +sm20 -Dcl_clang_storage_class_specifiers -S
> > -emit-llvm "$@"
> > Using the modified script, OpenCL kernels can be successfully compiled
> > PTX codes.
> But most of the builtin functions won't work.
I only tried a few kernels, including VectorAdd and Matrix Vector
Multiplication in the Nvidia OpenCL SDK. For the kernel mentioned in
Ankur's mail, it works as expected.
Please let me know how can the problem be solved. Thank you very much!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev