To port an existing code tto cuda? where to start

Hi guys,
I am investigating if it is possible https://github.com/japalmer29/amica to nvidia GPU [ cuda];
It seems that Fortran porting will need to take place.
I am just wondering how difficult it might be and where to start.
Thank you for any insights.

Hi Andrey,

I took a quick look over the code as see that it’s mostly comprised calls to BLAS and LAPACK routines which you’d could port to use cuBLAS and cuSOLVER. cuBLAS is fairly complete, but cuSOLVER only supports a sub-set of LAPACK so be sure to check if the specific solvers you use are available.

Porting Fortran codes to use cuBLAS is fairly straight forward since we provide an interface modules. Though if the code’s only using small matrices and/or vectors, it may not be beneficial to keep the code as is. In this case, you may want to look into batching together several small calls at once. https://developer.nvidia.com/blog/cuda-pro-tip-how-call-batched-cublas-routines-cuda-fortran/

Calling cuSOLVER routines are a bit more challenging, but not too bad.

More info on CUDA Fortran can be found at: https://docs.nvidia.com/hpc-sdk/compilers/cuda-fortran-prog-guide/index.html
with the CUDA Libraries interface modules at: https://docs.nvidia.com/hpc-sdk/compilers/fortran-cuda-interfaces/index.html

-Mat

Thank you for your response!