CUDA and HIP not allowed at the same time

This commit is contained in:
Razvan Nane 2023-10-08 08:57:37 +02:00
parent dcc3bd70f0
commit 7673118f14
2 changed files with 11 additions and 5 deletions

View File

@ -312,6 +312,13 @@ macro (files_hook)
set(HDF5_FOUND OFF) set(HDF5_FOUND OFF)
unset(HAVE_HDF5) unset(HAVE_HDF5)
endif() endif()
if(HAVE_ROCSPARSE AND HAVE_CUDA)
message(WARNING "WARNING! Using CUDA and HIP at the same time is not allowed. Please choose only one of them. Disabling both...\n")
set(CUDA_FOUND OFF)
set(rocsparse_FOUND OFF)
unset(HAVE_CUDA)
unset(HAVE_ROCSPARSE)
endif()
# read the list of components from this file (in the project directory); # read the list of components from this file (in the project directory);
# it should set various lists with the names of the files to include # it should set various lists with the names of the files to include
# include needs to be here to make reset HDF5_FOUND available in # include needs to be here to make reset HDF5_FOUND available in

View File

@ -151,11 +151,6 @@ if (Damaris_FOUND AND MPI_FOUND)
list (APPEND MAIN_SOURCE_FILES opm/simulators/utils/initDamarisXmlFile.cpp) list (APPEND MAIN_SOURCE_FILES opm/simulators/utils/initDamarisXmlFile.cpp)
endif() endif()
if(CUDA_FOUND) if(CUDA_FOUND)
if(USE_BDA_BRIDGE)
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/cuda/cusparseSolverBackend.cu)
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/cuda/cuWellContributions.cu)
endif()
# CUISTL SOURCE # CUISTL SOURCE
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/cuistl/detail/CuBlasHandle.cpp) list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/cuistl/detail/CuBlasHandle.cpp)
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/cuistl/detail/CuSparseHandle.cpp) list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/cuistl/detail/CuSparseHandle.cpp)
@ -222,6 +217,10 @@ if(USE_BDA_BRIDGE)
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/rocsparseSolverBackend.cpp) list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/rocsparseSolverBackend.cpp)
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/rocsparseWellContributions.cpp) list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/rocsparseWellContributions.cpp)
endif() endif()
if(CUDA_FOUND)
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/cuda/cusparseSolverBackend.cu)
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/cuda/cuWellContributions.cu)
endif()
if(amgcl_FOUND) if(amgcl_FOUND)
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/amgclSolverBackend.cpp) list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/amgclSolverBackend.cpp)
if(CUDA_FOUND) if(CUDA_FOUND)