Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 835c7d62 authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

make cublas available if found when CHAMELEON_USE_CUDA is ON

parent d01cef39
No related branches found
No related tags found
No related merge requests found
...@@ -410,6 +410,13 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/") ...@@ -410,6 +410,13 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
endif() endif()
set(CMAKE_REQUIRED_INCLUDES "${saved_include}") set(CMAKE_REQUIRED_INCLUDES "${saved_include}")
set(CMAKE_REQUIRED_LIBRARIES "${saved_libs}") set(CMAKE_REQUIRED_LIBRARIES "${saved_libs}")
# Add cublas if found
if (CUDA_CUBLAS_LIBRARIES)
message("-- ${Blue}Add definition CHAMELEON_USE_CUBLAS"
" - Use GPU kernels from cuBLAS${ColourReset}")
add_definitions(-DCHAMELEON_USE_CUBLAS)
list(APPEND EXTRA_LIBRARIES ${CUDA_CUBLAS_LIBRARIES})
endif()
#FindHeader(CUDA cublas_v2.h) #FindHeader(CUDA cublas_v2.h)
#if(CUDA_cublas_v2.h_DIRS) #if(CUDA_cublas_v2.h_DIRS)
#add_definitions(-DCHAMELEON_USE_CUBLAS_V2) #add_definitions(-DCHAMELEON_USE_CUBLAS_V2)
...@@ -424,13 +431,9 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/") ...@@ -424,13 +431,9 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
set(CHAMELEON_MAGMA_VERSION "1.4" CACHE STRING "oldest MAGMA version desired") set(CHAMELEON_MAGMA_VERSION "1.4" CACHE STRING "oldest MAGMA version desired")
find_package(MAGMA ${CHAMELEON_MAGMA_VERSION}) find_package(MAGMA ${CHAMELEON_MAGMA_VERSION})
if ( MAGMA_FOUND ) if ( MAGMA_FOUND )
message("-- ${Blue}Add definition CHAMELEON_USE_CUBLAS"
" - Use GPU kernels from cuBLAS${ColourReset}")
add_definitions(-DCHAMELEON_USE_CUBLAS)
message("-- ${Blue}Add definition CHAMELEON_USE_MAGMA" message("-- ${Blue}Add definition CHAMELEON_USE_MAGMA"
" - Use GPU kernels from MAGMA${ColourReset}") " - Use GPU kernels from MAGMA${ColourReset}")
add_definitions(-DCHAMELEON_USE_MAGMA) add_definitions(-DCHAMELEON_USE_MAGMA)
list(APPEND EXTRA_LIBRARIES ${CUDA_CUBLAS_LIBRARIES})
include_directories(${MAGMA_INCLUDE_DIRS}) include_directories(${MAGMA_INCLUDE_DIRS})
if(MAGMA_LIBRARY_DIRS) if(MAGMA_LIBRARY_DIRS)
# the RPATH to be used when installing # the RPATH to be used when installing
...@@ -711,7 +714,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/") ...@@ -711,7 +714,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
endif() endif()
list(REMOVE_DUPLICATES CMAKE_EXE_LINKER_FLAGS) list(REMOVE_DUPLICATES CMAKE_EXE_LINKER_FLAGS)
string(REPLACE ";" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") string(REPLACE ";" " " CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
# Add define for Fortran Mangling (should be defined somewhere else) # Add define for Fortran Mangling (should be defined somewhere else)
# ------------------------------------------------------------------ # ------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment