OpenACC-Library-Interoperability
Vladimír Fuka
vladimir.fuka@gmail.com
Wed Apr 27 17:16:00 GMT 2016
Hi!
> Correct. I'm not much of a Fortran programmer, but as far as I remember,
>Fortran doesn't have a notion of a pointer as C/C++ have. I suppose
>that's why the OpenACC specification defines that in Fortran, acc_copyin
>et al. are subroutines (no return value) instead of functions, and why
>acc_malloc, acc_deviceptr, acc_map et al. don't even exist in Fortran.
I already commented on this when Vikram asked about this issue at
stackoverflow: http://stackoverflow.com/questions/36577628/openacc-library-interoperability-how-to-get-device-pointer
In my opinion it is a clear defficiency of OpenACC and very likely caused due
to wrong information similar to "Fortran doesn't have a notion of a
pointer as C/C++ have.". Fortran 2003
has intrinsic derived type `c_ptr` which is interoperable with `void
*`. I don't know if
the C compiler does any magic besides returning or using the device
pointer as a `void *`, but if not I can't see
a reason why it can't be implemented in Fortran. That's why I also
suggested to Vikram to try to
create a Fortran interface to the C API functions himself. I think it
is likely to work but I don't know if he has tried it.
Vladimir
More information about the Fortran
mailing list