<div class="gmail_quote">On Wed, Oct 19, 2011 at 9:47 AM, Peter Collingbourne <span dir="ltr"><<a href="mailto:peter@pcc.me.uk">peter@pcc.me.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
This is to announce the availability of libclc, an open source, BSD<br>
licensed implementation of the library requirements of the OpenCL C<br>
programming language, as specified by the OpenCL 1.1 Specification.<br>
libclc is intended to be used with Clang's OpenCL frontend.<br>
<br>
libclc website: <a href="http://www.pcc.me.uk/~peter/libclc/" target="_blank">http://www.pcc.me.uk/~peter/libclc/</a><br>
<br>
libclc is designed to be portable and extensible. To this end,<br>
it provides generic implementations of most library requirements,<br>
allowing the target to override the generic implementation at the<br>
granularity of individual functions.<br>
<br>
libclc currently only supports the PTX target, but support for more<br>
targets is welcome.<br>
<br>
How does this project relate to the recently announced Portable OpenCL<br>
(POCL) project?  Unlike POCL, this project is not intended to provide<br>
an OpenCL host library (i.e. the OpenCL Platform Layer and OpenCL<br>
Runtime specified in sections 4-5 of the OpenCL specification).<br>
Instead, it provides only the requirements for the OpenCL C<br>
Programming Language (section 6 et seq).  It is intended to be used<br>
with an existing host library implementation, and comply with its<br>
ABI requirements.<br>
<br>
An example of such a host library is NVIDIA's OpenCL host library<br>
for PTX -- the intention is to at some point provide a mechanism<br>
for using the NVIDIA implementation of OpenCL with Clang, libclc<br>
and LLVM's PTX backend instead of NVIDIA's own OpenCL compiler.<br></blockquote><div><br></div><div>This is already semi-functional.  You can compile OpenCL code with Clang+libclc for ptx32, and load the resulting PTX as an OpenCL binary using Nvidia's OpenCL platform. :)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Another example would be POCL's host library, and the POCL developers<br>
have expressed an interest in using libclc as their OpenCL C library<br>
instead of developing their own.<br>
<br>
I will hope to find time over the next few weeks to add libclc support<br>
to the Clang driver.  The intention is that compiling OpenCL C programs<br>
to PTX would be as easy as (something like this):<br>
<br>
clang -target ptx32 -S <a href="http://file.cl" target="_blank">file.cl</a><br>
<br>
such that the driver would automatically locate the libclc headers,<br>
add them to the include path and pre-include the main header file.<br>
(The libclc support will of course be optional, and a -cl-stdlib=<br>
flag will be provided to allow for switching between OpenCL standard<br>
library implementations.)<br>
<br>
Thanks,<br>
<font color="#888888">--<br>
Peter<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div><br>