3D Array Reduction in ACC?

Hi,
I know $ACC reduction works for a variable, but may I get to know whether it should work for a 3D array? Say,
!$acc reduction(+:a(:,:,:))

Thanks,
Jingsen

Hi Jingsen,

Sorry, only scalars are allowed in reductions.

  • Mat

Hi Mat,
Very thankful for your clarification.
Will array reduction possibly be supported in future version of PGI? or this feature is not under planning at all?

In addtion, I’ve one more question. I remember you’ve told me that “critical” is not supported in ACC, but how about “Atomic”? If this not in current version, will it be allowed in the coming 2013 release?

Thanks,
Jingsen

Will array reduction possibly be supported in future version of PGI? or this feature is not under planning at all?

It would need to come from OpenACC committee since this restriction is defined by the OpenACC standard. See section 2.8.8 http://www.openacc.org/sites/default/files/OpenACC.1.0_0.pdf

I remember you’ve told me that “critical” is not supported in ACC, but how about “Atomic”? If this not in current version, will it be allowed in the coming 2013 release?

No, atomics are not part of the OpenACC standard. The problem is that synchronization features are device specific, if available at all. Given that the standard must cover a wide variety of devices, the OpenACC standard does not include synchronization.

If your algorithm must use atomics, I would suggest using CUDA Fortran or CUDA C for these particular kernels. OpenACC is interoperable with CUDA so you can mix.

Hope this helps,
Mat

Mat, thanks.
I cann’t use cuda inside $acc region, right?
Jingsen

I cann’t use cuda inside $acc region, right?

No, at least not yet. We are working on allowing calling from accelerator compute regions and by extension CUDA device routines. Of course, by adding CUDA in your code you will limit your portability.

  • Mat

Mat, I see.
Many thanks to you for alwasy being so fast on answering my questions!
Jingsen