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 22.09.2014 17:17, Thomas Schwinge wrote:
That works.  For avoidance of doubt: just tag to the actual
implementation (which is enough to avoid the references to
_gfortran_internal_unpack and _gfortran_internal_pack), or also the
interfaces, as detailed in the following "pseudo patch":

Well, the standard mandates that those match, thus, I think one should do it.

If one passes a noncontiguous array to a CONTIGUOUS dummy argument, the caller ensures that the argument is truly packed by creating a temporary and packing it, iff it is not contiguous. (If it is known at compile time that the array is contiguous, no run-time test is inserted.) The idea is to avoid wrong code, if one passes something noncontiguous. Hence, the caller has to see the attribute - and if it only sees the interface block and not the function itself, it must be in the interface block.

In case of OpenACC, the OpenACC semantics require that the argument is contiguous. If users gets it wrong, it will be wrong either way: If the variable is not packed and when it is packed (and the temporary removed after the function call).

Tobias


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