I programmed C, Fortran, and CUDA C for more than ten years and recently looked
at CUDA Fortran. I have to say that some CUDA Fortran API functions are really
designed against good programming practice, e.g. cudaGetDeviceProperties(prop, idev).
It would be better to use Fortran subroutine, instead of Fortran function,
in these cases.
See Page 79, Michael Metcalf, John Reid, and Malcolm Cohen, Fortran 95/2003
Explained, Oxford University Press, 2005.
5.10 Functions
It is permissible to write functions that change values of their arguments, …
However, these are known as side-effects and conflict with good programming
practice. Where they are needed, a subroutine should be used. …