I'm working on porting a Fortran code on GPU with OpenACC directives. The data structures contain allocatable arrays. When arrays are resized
- a new array (we can call it
tmp) is allocated with the new size - this new array
tmpis filled with the content of the allocatable array, attribute of the data structure (with additional 0 if required) - then move_array intrinsic is used to replace the allocatable in the structure by this new resized array
tmp(so no additional copy). If this is efficient in the host code I do not understand how to do this in a Kernel where my data structure and its allocatable are yet offloaded and my new arraytmpis created on the GPU.
I search in the OpenACC documentation but it does not look like an attach directive as after the move_array intrinsic call the tmp variable is in deallocated state. So I've no idea how to translate this in a kernel.