On Thu, May 21, 2015 at 02:38:19PM +0100, Julian Brown wrote:
> > All functions will behave that way, or just some using some magic
> > attribute etc.? Say will newlib functions behave this way (math
> > functions, printf, ...)?
>
> It's actually unclear at this point if "regular" functions are
> supported by OpenACC at all (the spec says nothing about them). They
> probably raise "interesting" questions about re-entrancy,
> synchronisation, and so on.
>
> > For math functions e.g. it would be nice if
> > they could behave both ways (perhaps as separate entrypoints), so
> > have the possibility to say how many threads from the warp will
> > perform the operation and then work on array arguments and array
> > return value (kind like OpenMP or Cilk+ elemental functions, just
> > perhaps with different argument/return value passing conventions).
>
> And that's something that's way outside the spec as currently defined,
> AFAIK.
Not necessarily. GCC uses the elemental functions not just in OpenMP/Cilk+
simd regions, but also in auto-vectorized code. So if auto-vectorization
for NVPTX target would just use the extra threads, it is relevant to OpenACC
as well. Not to mention that OpenMP is also relevant to NVPTX.
Jakub