[cfe-commits] [PATCH] OpenCL: introduce support for function scope __local variables

Peter Collingbourne peter at pcc.me.uk
Tue Sep 27 09:01:06 PDT 2011


On Fri, Sep 23, 2011 at 04:10:46PM -0700, Tanya Lattner wrote:
> Peter,
> 
> I'd like to know more about your OpenCLRuntime. What exactly is your long term plan here?
> 
> Unfortunately I have been really preoccupied with another project the least few months so I haven't devoted enough attention to these patches.

Hi Tanya,

I personally have no current plans to extend OpenCLRuntime.
The current OpenCLRuntime satisfies my own requirements.  I designed
OpenCLRuntime such that it might be extended by others for their
own requirements.

In this email to Anton Lokhmotov:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20110815/045187.html
I explained the motivation for the CGOpenCLRuntime class:

> One would develop support for a given OpenCL implementation
> by implementing a subclass of CGOpenCLRuntime, and modifying
> CodeGenModule::createOpenCLRuntime to return an instance of this
> subclass when appropriate.  The base class provides an example of a
> runtime that uses internal globals for work-group-local variables,
> and this can be changed by overriding the EmitWorkGroupLocalVarDecl
> function.
> 
> The main requirement for EmitWorkGroupLocalVarDecl is that it add
> the appropriate entry to LocalDeclMap.  For the base class, this is
> accomplished using CodeGenFunction::EmitStaticVarDecl, and this can
> be done in any appropriate way in a subclass.  If, for example, the
> implementation uses a hidden pointer argument for __local variables,
> it might emit getelementptr instructions indexing into the hidden
> argument and insert those instructions into LocalDeclMap.

Thanks,
-- 
Peter



More information about the cfe-commits mailing list