<div dir="ltr">Hi Guy,<div><br></div><div>Thanks a lot for the clarification.</div><div><br></div><div>I tried using the triple for SPIR as</div><div><br></div><div>$ clang -x cl -fno-builtin -emit-llvm -c -Xclang -triple -Xclang spir-unknown-unknown Simple_Kernel.cl </div>
<div><br></div><div>However I get the following error.</div><div>error: unknown target triple 'spir-unknown-unknown', please use -triple or -arch <br></div><div><br></div><div>I also tried with triple nvptx-unknown-unknown </div>
<div>clang -x cl -fno-builtin -emit-llvm -S -Xclang -triple -Xclang nvptx-unknown-unknown Simple_Kernel.cl </div><div><br></div><div>Then I get following error. </div><div>error: unknown target CPU 'pentium4'<br></div>
<div> </div><div>If I dont specify the triple, it compiles fine. However in the llvm generated, it shows the target triple as</div><div>target triple = "i386-pc-linux-gnu" </div><div><br></div><div>So it crashes with the llc ( due to the address space errors).</div>
<div><br></div><div>I also tried building llvm with only nvptx target, still the target triple is the same.</div><div><br></div><div>Please help.</div><div><br></div><div>Thanks a ton,</div><div>Ankur</div><div><br></div>
<div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 23, 2013 at 1:20 PM, Benyei, Guy <span dir="ltr"><<a href="mailto:guy.benyei@intel.com" target="_blank">guy.benyei@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple">
<div><p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hi Ankur,<u></u><u></u></span></p><p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">SPIR generation is not yet fully supported in Clang. I’m working on this task, but there are still some missing parts.<u></u><u></u></span></p>
<p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">The correct way to generate SPIR by Clang is adding the “-triple spir-unknown-unknown” or “-triple spir64-unknown-unknown” command line options when running clang.<u></u><u></u></span></p>
<p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Thanks<u></u><u></u></span></p>
<p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> Guy Benyei<u></u><u></u></span></p><p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><img width="420" height="116" src="cid:image001.png@01CDF94E.59EE30C0" alt="email_signature_guy_new2"><u></u><u></u></span></p>
<p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><div style="border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;border-top-style:solid;border-top-color:rgb(181,196,223);border-top-width:1pt;padding-top:3pt;padding-right:0in;padding-bottom:0in;padding-left:0in">
<p class=""><b><span style="font-size:10pt;font-family:Tahoma,sans-serif">From:</span></b><span style="font-size:10pt;font-family:Tahoma,sans-serif"> <a href="mailto:cfe-dev-bounces@cs.uiuc.edu" target="_blank">cfe-dev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:cfe-dev-bounces@cs.uiuc.edu" target="_blank">cfe-dev-bounces@cs.uiuc.edu</a>] <b>On Behalf Of </b>ankur deshwal<br>
<b>Sent:</b> Tuesday, January 22, 2013 11:09<br><b>To:</b> <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br><b>Subject:</b> [cfe-dev] OpenCL SPIR code generation<u></u><u></u></span></p></div>
<div><div class="h5"><p class=""><u></u> <u></u></p><div><p class="">Hi all,<u></u><u></u></p><div><p class=""><u></u> <u></u></p></div><div><p class="">I am trying to compile a openCL code to SPIR with LLVM/Clang-3.2. <u></u><u></u></p>
</div><div><p class=""><u></u> <u></u></p></div><div><p class="">I see there is no backend for SPIR( which makes sense as SPIR is variant of LLVM-IR). However this leads me clueless how to configure LLVM/Clang for SPIR and what is the command I shall use to generate SPIR code from cl code.<u></u><u></u></p>
</div><div><p class=""><u></u> <u></u></p></div><div><p class="">Thanks,<u></u><u></u></p></div><div><p class="">Ankur<u></u><u></u></p></div></div></div></div></div><p>---------------------------------------------------------------------<br>
Intel Israel (74) Limited</p><p>This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.</p><div><br></div></div></blockquote></div></div></div>