[cfe-dev] OpenCL compile object file symbol tables
james at jamesmolloy.co.uk
Tue Jan 21 01:15:42 PST 2014
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?
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev