[cfe-dev] OpenCL compile object file symbol tables

James Molloy james at jamesmolloy.co.uk
Tue Jan 21 01:15:42 PST 2014


Hi Albert,

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.

Clang is often used as *part of* a CL compiler - for example in POCL (
http://pocl.sourceforge.net/). 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.

Have you looked at POCL as an example of using Clang in a CL stack?

Cheers,

James


On 20 January 2014 20:15, Dorrington, Albert <albert.dorrington at lmco.com>wrote:

>  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.
>
>
>
> Is this by design?
>
>
>
> 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.
>
> For instance, after loading a pre-compiled binary with
> clCreateProgramWithBinary() and then validating that the kernel function
> contained therein is the expected kernel.
>
>
>
> *Al Dorrington*
>
> *Software Engineer Sr*
>
> *Lockheed Martin, Mission Systems and Training*
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140121/5cbedca0/attachment.html>


More information about the cfe-dev mailing list