[Mesa-dev] opencl (clover) patches question

Zack Rusin zackr at vmware.com
Sun Aug 1 08:16:03 PDT 2010

On Monday 26 July 2010 03:48:31 Jonathan Hamilton wrote:
> Hi,
> I have been looking into what would be needed to modify in clang to
> support opencl recently, although there is an opencl flag to set in the
> lang options, it doesn't really seem to do much, so the modifications
> seem non-trivial (to me at least). 

I think you're over-thinking it. I guess what you're referring is support for 
things like floatX (e.g. float4), __local and so on, but those aren't part of 
the language itself, they're actually simple defines. So what we need  is a 
private header which defines the OpenCL C types and attributes. E.g.
typedef __attribute__(( ext_vertex_type(4) )) float float4;
typedef __attribute__(( ext_vertex_type(2) )) float float2;
and so on. Each compiled OpenCL kernel would implicitly include this header. 
We'll need pretty much the same thing for builtins (but along with actual 
definitions of those).

> Also, am I correct in assuming that the general flow goes:
> openCL code -> clang -> llvm bytecode -> TGSI -> gallium driver?

That's exactly right.


More information about the mesa-dev mailing list