[PATCH] Add support for CUDA unroll pragma

Aaron Ballman aaron.ballman at gmail.com
Thu Jun 26 10:01:40 PDT 2014


On Thu, Jun 26, 2014 at 1:00 PM, Mark Heffernan <meheff at google.com> wrote:
> On Thu, Jun 26, 2014 at 9:56 AM, Aaron Ballman <aaron.ballman at gmail.com>
> wrote:
>>
>> I agree with Richard's opinion for the invented syntax, but this is a
>> bit different since this syntax is specified by NVidia and supported
>> on compilers other than clang. I am okay with this pragma not being in
>> the clang namespace since that makes the code compatible with other
>> compilers, presuming that clang's behavior matches that of other
>> compilers implementing the same syntax.
>
>
> One clarification on support in other compilers.  Alas, Intel and IBM have
> slightly different syntax for the case where an unroll count is specified:
>
> IBM and Intel:
> #pragma unroll(n)
>
> CUDA:
> #pragma unroll n

Might be worth exploring whether we want to support both forms? The
parsing for either is unambiguous.

~Aaron



More information about the cfe-commits mailing list