[cfe-dev] CUDA patch series 2 (was Re: Proposal: CUDA support; outline, initial patches)

Chris Lattner clattner at apple.com
Mon Nov 29 14:59:19 PST 2010


On Nov 24, 2010, at 8:49 PM, Peter Collingbourne wrote:

> On Sun, Nov 21, 2010 at 05:58:20AM +0000, Peter Collingbourne wrote:
>> With a Clang-based driver, we can do better, by parsing the source
>> file once to produce a single AST,
> 
> After further investigation, I determined that this won't work.
> CUDA (at least the NVIDIA SDK headers) depends on certain macros and
> declarations being subtly different for host and device code.
> The new strategy is to parse the source file twice, once for the host and
> once for the device.  CodeGen would still be responsible for filtering
> declarations.

Ok.

> This new patch series is built on top of the old series and replaces
> patch 11 (which was based on the mistaken assumption that the type
> qualifiers weren't attributes hiding behind a #define) and implements:
> - Initial support for device, global, host, constant, shared and
>   launch_bounds attributes.  The attributes are recognised and added
>   to the AST but no significant semantic analysis (e.g. checking
>   for incompatible combinations) is performed.

Ok, please trickle the patches in one at a time.  Starting here makes sense.  In this patch, please use attribute names like attribute(cuda_device) etc instead of just "device" to avoid ambiguity.  Also, these attributes should be rejected when not in cuda language mode.  The prerequisite for that is to add a cuda language mode.

-Chris



More information about the cfe-dev mailing list