CUBLAS routines using Portland under Centos6 and Cuda 5

I want to use the cublas routines from Portland fortran or in some caes intel. The fotran.c fail to compile. I do not have g95 available. I have gcc suite 4.8.0 (gcc/gfortran), Portland 13.3 and Intel 2013.3 available and new Kepler architecture cards. The SDK examples work fine, Portland accelerator work fine. However, I would like to be able to call sgemm and dgemm (c and z too) from Fortran compiled with the Portland compiler.

How do I build the fortran.c wrapper so I can get a library that I can link in and call ?gemm from fortran using Portland or Intel ?

The performance in the matrix multiply examples in the SDK yield over one Tflops/s which is quite good.
Hence my wish to call the highly optimized blas routines.

Ole

fortran.c should compile fine using gfortran

What is your compilation problem?

It is not clear to me which “Portland Fortran” product you have. Your statement “SDK examples work fine” presumably refers to the CUDA SDK, and I take that as an indication that you are working with PGI CUDA Fortran.

If so, this compiler comes with a handy module that interfaces to CUBLAS. Simply add “use cublas” to your host program. A worked example of CUBLAS calls via this module is on page 56 of the CUDA Fortran Programming Guide and Reference, an online copy of which can be found at http://www.pgroup.com/lit/whitepapers/pgicudaforug.pdf