It is a doddle. I have large(ish) f90 codes that call many gpu routines written
mostly by me but I also use clFFT (see below).
U need to write a "wrapper" - a C routines that is called from fortran. Here how it is done:
f90 calling routine:
Call getp_ocl( P(1,1,I), PP(1,1,I), N1, 0, JPLEN, KPLEN, MY*NY, MZ*NZ, 0 )
Now the corresponding C routine is:
void getp_ocl_( double P[], double TMP[], int *LENX, int *IOFF, \
int *LENY, int *LENZ, int *YDIM, int *ZDIM, int *N_GPU )
{
stuff here
}
Note the appended underscore in the c routine - this is needed
by most compilers - but not all. Test your sys for what works.
Compile the fortan part with -c option
Compile the C part (with gcc) also with -c. Do not forget the various
paths for loading the libs and include headers.
Link the *.o files with your linker.
Regarding math libs on amd gpus, you may find that you need to writre
your own stuff. I am currently using clFFT extensively but it does not
work (by design) on multiple gpu cards. So I am now writing my own
fft kernels.
good luck
--