<div dir="ltr">Hi Albert,<div><br></div><div>Clang is not in and of itself an OpenCL compiler. It has a frontend for OpenCL-C, and can produce LLVM-IR from that (which can then be pushed through LLVM to produce some machine code). But those generated functions would be useless.</div>
<div><br></div><div>Clang is often used as *part of* a CL compiler - for example in POCL (<a href="http://pocl.sourceforge.net/">http://pocl.sourceforge.net/</a>). The IR generated from Clang for CL-C code doesn't contain any details of how it is going to be executed. For example, is it going on a GPU or a CPU? In the latter case, loops will need to be inserted and calls to get_local_id() will need to reference the loop induction variables. There'll need to be some way inserted of being able to pass the group ID and other payload-global data too.</div>
<div><br></div><div>Have you looked at POCL as an example of using Clang in a CL stack?</div><div><br></div><div>Cheers,</div><div><br></div><div>James</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On 20 January 2014 20:15, Dorrington, Albert <span dir="ltr"><<a href="mailto:albert.dorrington@lmco.com" target="_blank">albert.dorrington@lmco.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">When I compile an OpenCL kernel to a binary file, using llvm/clang, I don’t see the kernel functions defined within the symbol table.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is this by design?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Without the function names in the symbol table, I’m not sure how I would look up a function within a pre-compiled object file.<u></u><u></u></p>
<p class="MsoNormal">For instance, after loading a pre-compiled binary with clCreateProgramWithBinary() and then validating that the kernel function contained therein is the expected kernel.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b><span style="font-size:14.0pt">Al Dorrington<u></u><u></u></span></b></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt">Software Engineer Sr<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span style="font-size:10.0pt">Lockheed Martin, Mission Systems and Training<u></u><u></u></span></i></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>