[cfe-dev] OpenCL support

Mike Gist Mike.Gist at imgtec.com
Fri Dec 10 15:18:22 PST 2010


-----Original Message-----
From: cfe-dev-bounces at cs.uiuc.edu on behalf of Anton Lokhmotov
Sent: Fri 10/12/2010 18:21
To: cfe-dev at cs.uiuc.edu
Subject: [cfe-dev] OpenCL support
 
> 1) For kernel functions (with the __kernel qualifier), we insert named
> metadata nodes into LLVM-IR.  Other options we have evaluated included:
> - Shipping metadata separately from bitcode.  This would be hard to
> standardise on and maintain.
> - Using imaginative name mangling.  This would be pretty horrible too and
> easy to misuse.
>
> The drawback of course is that metadata can be "silently dropped".  However,
> we are not aware of any transforms that would do this.  Perhaps the
> community should consider defining "sticky metadata"?

You could also consider placing all kernel functions in a 'kernel' section, or
adding a function attribute for kernels.

Inserting metadata feels a little dirty to me, it shouldn't be used if it would change
the semantics of the program (which it would in this case). Some kind of 'sticky' metadata
would indeed get around 'dropping', however I don't believe (I may be wrong) that metadata was
designed for this purpose. I'm not sure that trying to fit it to this purpose is a good idea.


> Please review and comment.

cl_khr_byte_addressable_store is probably a fairly well supported 1.0 extension that
you could add too :) Those will have to be disabled by default for 1.0 anyhow.

Regards,
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101210/82982609/attachment.html>


More information about the cfe-dev mailing list