Shared memory cannot be Fortran automatic array

Hello:

From the implementation of my three codes, it is found that in CUDA FORTRAN, the shared memory cannot be Fortran automatic array. the size of shared memory has to be assumed to be fixed size. Can you fix this point, please?

The codes are run on two GPU clusters. IRIDIS cluster at university of southampton and emerald GPU cluster.

After further test, it is found the codes work fine before PGI 14.7 and fails after PGI 14.9.

Best,
Shuming

Hi Shuming,

Shared memory arrays do need to be assumed or fixed size. However, the size of the assumed-size arrays can be dynamically adjusted by setting the size in bytes of the shared memory used per block as the third launch configuration parameter.

An example using shared memory of this can be found in Chapter 3 of “CUDA Fortran for Scientist and Engineers”. You can download all the example source code from the book at http://booksite.elsevier.com/9780124169708/.

Hope this helps,
Mat

Yes. I know it. Probably I did not show my meaning clearly.

What I am going to say is that I ran a code with dynamically allocated shared memory, it worked fine before PGI 14.7 on two GPU clusters. When the code was compiled and ran with PGI 14.9 and 14.10, the result was wrong. When I made shared memory fixed size, the codes worked fine again. This situation appeared in my two codes and two clusters.

So my request is whether you can verify this point in PGI 14.10 again, please? If it is true, can you fix this bug?

Best,
Shuming

Hi Shuming,

Thank you for the clarification. I do see one problem report, TPR#20956 reported with the 14.9 compilers. The error occurs when using multiple dynamically sized shared arrays in a CUDA Fortran Kernel, the index to the second array is being calculated incorrectly. Does this sound similar to your issue?

TPR#20956 will be fixed in the up-coming 15.1 release due out soon.

If your issue does not match this description, please send a reproducing example to PGI Customer Service (trs@pgroup.com).

Best Regards,
Mat

Hi Mat:

Yes. It sounds similar.

Best,
Shuming