<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jul 7, 2014 at 5:18 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">----- Original Message -----<br>
> From: "Mark Heffernan" <<a href="mailto:meheff@google.com">meheff@google.com</a>><br>
> To: "Richard Smith" <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>><br>
> Cc: <a href="mailto:reviews%2BD4297%2Bpublic%2B26d6caf125d429ed@reviews.llvm.org">reviews+D4297+public+26d6caf125d429ed@reviews.llvm.org</a>, "Aaron Ballman" <<a href="mailto:aaron.ballman@gmail.com">aaron.ballman@gmail.com</a>>, "llvm cfe"<br>

> <<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a>><br>
> Sent: Monday, July 7, 2014 6:12:00 PM<br>
> Subject: Re: [PATCH] Add support for CUDA unroll pragma<br>
><br>
><br>
><br>
><br>
><br>
> On Tue, Jul 1, 2014 at 5:36 PM, Richard Smith < <a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a><br>
> > wrote:<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> One question: you list the unroll count as 'n'. Must that be a<br>
> constant integer? The clang pragma intends to allow an arbitrary<br>
> integer constant expression there. That might be a good reason for<br>
> us to introduce our own syntax for it, if we're providing a slightly<br>
> more general form.<br>
><br>
><br>
><br>
> nvcc (CUDA) only supports a literal integer constant. icc seems to<br>
> support only literal constants as well. xlc supports integer<br>
> constant expressions. Given xlc and icc share the same syntax<br>
> ("#pragma unroll (_value_)") there is no way to be perfectly<br>
> compatible with both icc and xlc so I'm inclined to support<br>
> expressions in "#pragma unroll" as planned with the other loop<br>
> pragmas and just be more permissive than nvcc and icc.<br>
<br>
</div></div>At least in CUDA mode, we may want to issue a warning for non-literal-constants.</blockquote><div><br></div><div>That seems reasonable to me.</div><div><br></div><div>Since we might want these two syntaxes to have different semantics, and since having duplicates is cheap (and makes our #pragma clang loop interface more consistent), I'd prefer to support both '#pragma unroll' and '#pragma clang loop unroll'. </div>
</div></div></div>