[cfe-dev] Simple S2S translator (OpenCL -> WebCL)

steveneliuk s.eliuk at sisa.samsung.com
Thu Feb 21 11:09:40 PST 2013


Hi everyone,

First, looks like a great community and there is tons of knowledge that
everyone has contributed.

I will try to not make this too verbose,

I would like some feedback on creating a simple opensource s2s translator
(OpenCL -> WebCL),

With the help of a colleague I have a very naive implementation using libclc
to test out some basic functionality,

Now my domain expertise are not in clang, llvm, or compilers. I do have a
high level understanding of the inner workings though, through my research
over the last few days. Therefore, excuse the naiveness of the questions,

My basic idea is to only translate/rewrite those declarations and function
calls that are found in OpenCL 1.1 to the current WebCL 1.0 Working Draft
(WD) specifications. I believe libclc defines all of these, and one would
simply only check those declarations and function calls that are contained
in libclc. If the call parsed code is not contained, then simply rewrite it,
only making changes to the OpenCL code snippets.

I found how to include the libclc using:
compiler.getHeaderSearchOpts().AddPath("libclc/include/",
                                               clang::frontend::System,
                                               false, false);

For some reason though we are still missing some basic OpenCL setup calls
like
 getCommandQueue().enqueueWriteBuffer(args...) 

I checked libclc and there doesnt seem to be anything...

Thoughts or suggestions?

Greatly appreciate the directional advice,

Regards,






--
View this message in context: http://clang-developers.42468.n3.nabble.com/Simple-S2S-translator-OpenCL-WebCL-tp4030546.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list