This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Implementing OpenACC's Fortran module


On 19.09.2014 11:03, Thomas Schwinge wrote:
Regarding linking the object file produced by Fortran openacc.f90 into libgomp: (with the version that Jim already has internally checked in) I find that libgomp then has undefined references to _gfortran_internal_unpack and _gfortran_internal_pack.

Internal pack and unpack appears when you a (potentially) noncontiguous array is passed as argument to an argument which requires a contiguous argument. Internal pack checks at run time whether the argument is contiguous - and if not it creates a temporary and copies the data to the temporary ('copy in') - internal unpack ensures for all arrays but intent(in) that the data is propagated back to the original one.

I am pretty sure that copy-in will break the OpenACC functions.

One possibility would be to mark the dummy arguments in openacc.f90 as CONTIGUOUS. That way, no internal pack/unpack is called by openacc.f90. (If one has a noncontiguous array, the caller of openacc.f90 will do the copy in/out.)

Thus, you could try to add ", contiguous" to all procedures which take an assumed-rank array "(..)" as argument.

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]