[cfe-dev] OpenCL support

Pekka Jääskeläinen pekka.jaaskelainen at tut.fi
Fri Nov 26 08:12:57 PST 2010


Hi,

26.11.2010 11:49, Alberto Magni kirjoitti:
> Now I plan to add the support for code generation.

We have worked on this at TUT and URJC and have LLVM passes
that add the required work item loops + optionally do work
item chaining/merging to produce more ILP or vectorizing
opportunities for the final code generation. It doesn't yet
handle all the barrier cases but could be a good starting point.
I think the loops are the main thing needed before the kernel
code can be executed on a target that is not SPMD.

Our plan has been to release those passes but we haven't
had time for that.

The passes are described in this paper:
http://tce.cs.tut.fi/papers/StandaloneOpenCL.pdf

Currently our compilation flow assumes 
__attribute__((reqd_work_group_size(X, Y, Z)))
in the kernel and the passes detect the kernels in the bitcode
by a function naming convention and everything is compiled offline
together with the OpenCL host program to produce parallelizable
code for ASIPs.

So far we have used a hackish custom python preprocessor to
process the OpenCL kernel code to C++ and we would like to get
rid of this by, for example, using Clang.

The passes should be converted to use the metadata you mentioned and
possibly a parameter to the LLVM pass for setting the work group
dimensions so they become usable for executing the OpenCL kernel
compiler from the OpenCL main program. The passes need to know
how many times they should/can merge the work items etc.

You can ask Carlos Sánchez de La Lama for more info and
the code if you are interested as he is the main author.
He should be subscribed to this list.

BR,
-- 
Pekka Jääskeläinen



More information about the cfe-dev mailing list