Are there any OpenAcc compilers that support the copying of derived types containing allocatable arrays to/from the GPU and their use in accelerated code?
The OpenACC spec (v2.0) states this is possible, but I'm unable to find it implemented in a compiler anywhere. The PGI compiler supports derived types, but seemingly not those containing allocatable arrays (see this page on the PGI forum). While this may have changed since them, it doesn't seem to be publicised (well) anywhere.
For now I'm unable to access the Cray or CAPS compilers, and the PGI compiler does not support this functionality. A suitable workaround seems to be to create a pointer to the allocatable array within the derived type and copy that to the GPU using the copy
clause. If future versions of the PGI compiler support this kind of deep copy then I'll update the answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With