diff --git a/configure.ac b/configure.ac index de4949c..d3c9471 100644 --- a/configure.ac +++ b/configure.ac @@ -246,10 +246,41 @@ fi ## Enable GPU offloading -# OpenACC offloading -AC_ARG_ENABLE(openacc, [AS_HELP_STRING([--enable-openacc],[Use OpenACC-offloaded functions])], HAVE_OPENACC_OFFLOAD=$enableval, HAVE_OPENACC_OFFLOAD=no) -AS_IF([test "$HAVE_OPENACC_OFFLOAD" = "yes"], [ +# GPU offloading +AC_ARG_ENABLE(gpu, [AS_HELP_STRING([--enable-gpu],[openmp|openacc : Use GPU-offloaded functions])], enable_gpu=$enableval, enable_gpu=no) +AS_IF([test "$enable_gpu" = "yes"], [enable_gpu="openmp"]) + +# OpenMP offloading +HAVE_OPENMP_OFFLOAD="no" +AS_IF([test "$enable_gpu" = "openmp"], [ + AC_DEFINE([HAVE_OPENMP_OFFLOAD], [1], [If defined, activate OpenMP-offloaded routines]) + HAVE_OPENMP_OFFLOAD="yes" + case $CC in + + *gcc*) + CFLAGS="$CFLAGS -fopenmp" + ;; + *nvc*) + CFLAGS="$CFLAGS -mp=gpu" + ;; + esac + + case $FC in + + *gfortran*) + FCFLAGS="$FCFLAGS -fopenmp" + ;; + *nvfortran*) + FCFLAGS="$FCFLAGS -mp=gpu" + ;; + esac] +) + +# OpenMP offloading +HAVE_OPENACC_OFFLOAD="no" +AS_IF([test "$enable_gpu" = "openacc"], [ AC_DEFINE([HAVE_OPENACC_OFFLOAD], [1], [If defined, activate OpenACC-offloaded routines]) + HAVE_OPENACC_OFFLOAD="yes" case $CC in *gcc*) @@ -430,6 +461,7 @@ LDFLAGS:........: ${LDFLAGS} LIBS............: ${LIBS} USE CHAMELEON...: ${with_chameleon} HPC version.....: ${HAVE_HPC} +OpenMP offload..: ${HAVE_OPENMP_OFFLOAD} OpenACC offload.: ${HAVE_OPENACC_OFFLOAD} cuBLAS offload..: ${HAVE_CUBLAS_OFFLOAD}