<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hi guys,</p>
<p><br>
</p>
<p>I've been trying to get Clang 5.0 to compile a very simple OpenCL kernel example to SPIR (1.2) so that I can run it through another program that basically loads the SPIR binary and executes it. </p>
<p><br>
</p>
<p>However I've been having some issues in that the program loads up the binary fine and executes it getting the wrong result. Now I don't believe this is an issue with the program that loads the binary or the OpenCL kernel itself for a couple of reasons 1)
 Is that I can compile the OpenCL kernel to SPIR using the Intel Offline Compiler and the Khronos SPIR compiler (based off of Clang/LLVM 3.3) and the returned SPIR binary will run through the program and output as expected and 2) I can just run the OpenCL code
 through it and output the compiled binary and then run that binary back through and get the correct results.  </p>
<p><span style="font-size: 12pt;">  </span></p>
<p>So at the moment I'm unsure if this is to do with the compile command I'm giving to Clang is slightly off or if the output llvm from Clang 5.0 no longer supports SPIR 1.0/1.2 (although the Clang 5 documentation leads me to believe it does still support it)?</p>
<p><br>
</p>
<p>The compiler command I'm feeding to Clang at the moment is: </p>
<div>clang -cc1 -isystem $LIBCLC/generic/include -include clc/clc.h -Dcl_clang_storage_class_specifiers -<span style="font-size: 12pt;">triple spir64-unknown-unknown -x cl -cl-std=CL1.2 -emit-llvm -o $NAME.ll $NAME.cl</span></div>
<div><span style="font-size: 12pt;"><br>
</span></div>
<div><span style="font-size: 12pt;">Although I've tried a number of variations from the documentation with no luck.</span></div>
<p></p>
<p><br>
</p>
<p>Thank you very much for your time, and help with this matter.</p>
<p><br>
</p>
<p>Best Regards,</p>
<p>Andrew Gozillon</p>
</div>
<br>
<br>
Please consider the environment and think before you print. <br>
<br>
The University of the West of Scotland is a registered Scottish charity. Charity number SC002520.
<br>
<br>
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other
 party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.
<br>
<br>
Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the University of the West of Scotland.
<br>
<br>
As a public body, the University of the West of Scotland may be required to make available emails as well as other written forms of information as a result of a request made under the Freedom of Information (Scotland) Act 2002.
</body>
</html>