<div class="gmail_extra">Hi Peter,</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 27, 2012 at 7:36 PM, Peter Collingbourne <span dir="ltr"><<a href="mailto:peter@pcc.me.uk" target="_blank">peter@pcc.me.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Apr 27, 2012 at 11:37:13AM +0800, Lei Mou wrote:<br>
> Hi Ankur,<br>
><br>
> Yes, you need the support of libclc in order to successfully compile OpenCL<br>
> kernels. It is available at <a href="http://libclc.llvm.org/" target="_blank">http://libclc.llvm.org/</a>. After building libclc,<br>
> you can use the script "compile-test.sh" to compile OpenCL kernels. For me,<br>
> the compile-test.sh has a little problem (due to the option -Xclang<br>
> ptx32--nvidiacl/lib/builtins.bc), so I just removed the option, and the<br>
<br>
</div>What problem? Did you follow the instructions in README.TXT to build<br>
the builtins.bc file?</blockquote><div><div class="gmail_extra"><br class="Apple-interchange-newline">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:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">ptx32--nvidiacl/lib/builtins.bc:299:196: warning: null character ignored</div><div class="gmail_extra">2�>���M 0 !����<� �D��#>R��� hS � �>b� ODH>�#��;<F PT�5ن �T��4��#��! !��p@ �H}�e�Q ��#� �D��#>���c� HE\��� $ !���-$ �,>�#� �,>�# �T��4�d��� �8 ���A8��T>��#un� �</div>
<div class="gmail_extra"> ^</div>
<div><div>fatal error: too many errors emitted, stopping now [-ferror-limit=]</div><div>2900 warnings and 20 errors generated.</div></div><div><br></div><div class="gmail_extra">I don't know what's the problem, so I just removed the option from the script.</div>
</div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> resulting script looks like this:<br>
><br>
> clang -ccc-host-triple ptx32--nvidiacl -Iptx-nvidiacl/include<br>
> -Igeneric/include -include clc/clc.h -target-feature -Xclang +ptx23 -Xclang<br>
> -target-feature -Xclang +sm20 -Dcl_clang_storage_class_specifiers -S<br>
> -emit-llvm "$@"<br>
><br>
> Using the modified script, OpenCL kernels can be successfully compiled into<br>
> PTX codes.<br>
<br>
</div>But most of the builtin functions won't work.<br></blockquote><div><br></div><div>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. </div>
<div>Please let me know how can the problem be solved. Thank you very much! </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Peter<br>
</font></span></blockquote></div><br></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Lei Mou</div>