[PATCH] Add support for CUDA unroll pragma

Hal Finkel hfinkel at anl.gov
Mon Jul 7 17:18:36 PDT 2014


----- Original Message -----
> From: "Mark Heffernan" <meheff at google.com>
> To: "Richard Smith" <richard at metafoo.co.uk>
> Cc: reviews+D4297+public+26d6caf125d429ed at reviews.llvm.org, "Aaron Ballman" <aaron.ballman at gmail.com>, "llvm cfe"
> <cfe-commits at cs.uiuc.edu>
> Sent: Monday, July 7, 2014 6:12:00 PM
> Subject: Re: [PATCH] Add support for CUDA unroll pragma
> 
> 
> 
> 
> 
> On Tue, Jul 1, 2014 at 5:36 PM, Richard Smith < richard at metafoo.co.uk
> > wrote:
> 
> 
> 
> 
> 
> 
> 
> One question: you list the unroll count as 'n'. Must that be a
> constant integer? The clang pragma intends to allow an arbitrary
> integer constant expression there. That might be a good reason for
> us to introduce our own syntax for it, if we're providing a slightly
> more general form.
> 
> 
> 
> nvcc (CUDA) only supports a literal integer constant. icc seems to
> support only literal constants as well. xlc supports integer
> constant expressions. Given xlc and icc share the same syntax
> ("#pragma unroll (_value_)") there is no way to be perfectly
> compatible with both icc and xlc so I'm inclined to support
> expressions in "#pragma unroll" as planned with the other loop
> pragmas and just be more permissive than nvcc and icc.

At least in CUDA mode, we may want to issue a warning for non-literal-constants.

 -Hal

> 
> 
> Mark
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-commits mailing list