问题
I have been looking at porting a cuda library to fortran. PGI and EM Photonics seem to be two libraries that exist right now. However I have only found what I am looking for over here
real, device, allocatable :: adev(:), bdev(:) ! device declaration
So my question is, is there a way to create custom arrays like the code sample mentioned above ? Or is it part of the propreitary compiler from PGI ?
Edited for further clarity
In other words can I do this
mycustomtype, allocatable :: tmp(:)
回答1:
No, that is standard Fortran. There are several ways to declare arrays; this one in particular is called declaring a deferred-shape allocatable array.
Your best shot would be to check out PGI's documentation under array declaration.
来源:https://stackoverflow.com/questions/5751000/how-to-create-custom-arrays-in-fortran