test_GPU.cmake 2.47 KB
Newer Older
1
#Check if we can compile with GPU
2
if (CLI_FLEUR_USE_GPU)
3 4
   #No check is done
   set(FLEUR_USE_GPU TRUE)
5 6 7 8 9
   message("GPU:${CLI_FLEUR_USE_GPU}")
   if (${CLI_FLEUR_USE_GPU} MATCHES "cuda8")
      set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ta=tesla:cuda8.0,cc60 -Mcuda:kepler+ -Minfo=accel -Mcudalib=cublas -acc ")
      message("Using cuda8")
   elseif(${CLI_FLEUR_USE_GPU} MATCHES "cuda9")
10
      set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.0,cc60 -Mcuda=rdc -Mcudalib=cublas")
11 12
   elseif(${CLI_FLEUR_USE_GPU} MATCHES "cuda9.1")
      set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.1,cc60 -Mcuda=rdc -Mcudalib=cublas")
13
   elseif(${CLI_FLEUR_USE_GPU} MATCHES "nvtx")
14 15
      #set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}  -Mcuda=cuda9.1,cc60,ptxinfo,lineinfo -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt ")
      set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}  -Mcuda=cuda9.1,cc60 -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt ")
16 17 18 19
   elseif(${CLI_FLEUR_USE_GPU} MATCHES "magma")
      #set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}  -Mcuda=cuda9.1,cc60 -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt -lmagma -lmkl_intel_lp64 -lmkl_core")
      #set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}  -Mcuda=cuda9.2,cc60 -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt -lmagma -lmkl_intel_lp64 -lmkl_core")
      set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}  -Mcuda=cc60 -Mcuda=rdc -lcublas -lnvToolsExt -lmagma -lmkl_intel_lp64 -lmkl_core")
20
   elseif(${CLI_FLEUR_USE_GPU} MATCHES "emu")
21 22
      #set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=emu -Mcudalib=cublas -Minfo=accel ")
      set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=emu -Mcudalib=cublas ")
23
   endif()
Daniel Wortmann's avatar
Daniel Wortmann committed
24 25
   set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_GPU" "CPP_MANAGED=,MANAGED")
   set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_GPU" "CPP_MANAGED=,MANAGED")
26
#Now check for cusolverDN library
27 28 29 30 31 32 33 34 35
#   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mcuda -ta=tesla,cuda9.1 ")
#   try_compile(FLEUR_USE_CUSOLVER ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_cusolver.c
#	    LINK_LIBRARIES "-lcusolver"
#            )
#   if (FLEUR_USE_CUSOLVER)
#     set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};-lcusolver")
#     set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_CUSOLVER")
#     set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_CUSOLVER")
#   endif()
36 37
else()
   set(FLEUR_USE_GPU FALSE)
Daniel Wortmann's avatar
Daniel Wortmann committed
38 39
   set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_MANAGED=")
   set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_MANAGED=")
40
endif()