GPU offloading in Fortran

Oh ha! if I do:

FPM_FC=$GCC_DIR/bin/gfortran fpm run --flag="-fopenacc" --link-flag="-fopenacc -lcublas" --verbose
 <INFO> BUILD_NAME: build/gfortran
 <INFO> COMPILER:  /home/jorge/install/ompoffload/gcc//bin/gfortran
 <INFO> C COMPILER:  gcc
 <INFO> CXX COMPILER: g++
 <INFO> COMPILER OPTIONS:   -fopenacc
 <INFO> C COMPILER OPTIONS:
 <INFO> CXX COMPILER OPTIONS:
 <INFO> LINKER OPTIONS:   -fopenacc -lcublas
 <INFO> INCLUDE DIRECTORIES:  []
[100%] Project compiled successfully.
 + build/gfortran_4871D01AF1A03C0E/app/app-name
   11.0000000         11.0000000
   19.0000000         19.0000000
   27.0000000         27.0000000
   35.0000000         35.0000000
   43.0000000         43.0000000
   51.0000000         51.0000000
   59.0000000         59.0000000
   67.0000000         67.0000000
   75.0000000         75.0000000
   83.0000000         83.0000000

It works…

1 Like