fix breakage for gpu bridge with no cuda

This commit is contained in:
Arne Morten Kvarving committed 2026-02-13 09:19:59 +01:00
1 parent bb43d1b6d2
commit d3ddee8f55
4 files changed
+57 -76

No files matched your search

+53 -72
View File
@@ -256,72 +256,61 @@ macro(opm-simulators_tests_hook)
endif()
if(CUDA_FOUND OR hip_FOUND)
if(USE_GPU_BRIDGE)
set_tests_properties(cusparseSolver PROPERTIES LABELS gpu_cuda)
endif()
# CUISTL
set(gpu_label "gpu_cuda")
if(USE_HIP)
set(gpu_label "gpu_hip")
endif()
set_tests_properties(
cusparse_safe_call
cublas_safe_call
gpu_safe_call
cuda_check_last_error
cublas_handle
GpuJac
GpuDILU
cusparse_handle
cuSparse_matrix_operations
cuVector_operations
GpuVector
GpuSparseMatrix
GpuSeqILU0
solver_adapter
GpuBuffer
GpuView
gpu_ad
gpu_linear_two_phase_material
gpuPvt
gpu_resources
gpu_smart_pointers
is_gpu_pointer
throw_macros_on_gpu
preconditioner_factory_gpu
gpuBlackOilFluidSystem
blackoilfluidstategpu
conditional_storage
GpuPressureTransferPolicy
deviceBlockOperations
primary_variables_gpu
MiniVector
MiniMatrix
GpuSparseTable
PROPERTIES
LABELS
${gpu_label}
)
if(MPI_FOUND)
set_tests_properties(GpuOwnerOverlapCopy PROPERTIES LABELS ${gpu_label})
endif()
endif()
if(HYPRE_FOUND)
if (HYPRE_USING_CUDA)
set_tests_properties(HyprePreconditionerGPU PROPERTIES LABELS gpu_cuda)
set_tests_properties(HypreInterfaceGPU PROPERTIES LABELS gpu_cuda)
elseif (HYPRE_USING_HIP)
set_tests_properties(HyprePreconditionerGPU PROPERTIES LABELS gpu_hip)
set_tests_properties(HypreInterfaceGPU PROPERTIES LABELS gpu_hip)
endif()
endif()
if(AMGX_FOUND)
set_tests_properties(AmgxInterface PROPERTIES LABELS gpu_cuda)
set_tests_properties(AmgxPreconditioner PROPERTIES LABELS gpu_cuda)
foreach(test
AmgxInterface
AmgxPreconditioner
blackoilfluidstategpu
conditional_storage
cublas_handle
cublas_safe_call
cuda_check_last_error
cusparse_handle
cuSparse_matrix_operations
cusparse_safe_call
cusparseSolver
cuVector_operations
deviceBlockOperations
gpu_ad
gpu_linear_two_phase_material
gpu_resources
gpu_safe_call
gpu_smart_pointers
gpuBlackOilFluidSystem
GpuBuffer
GpuDILU
GpuJac
GpuOwnerOverlapCopy
GpuPressureTransferPolicy
gpuPvt
GpuSeqILU0
GpuSparseMatrix
GpuSparseTable
GpuVector
GpuView
HypreInterfaceGPU
HyprePreconditionerGPU
is_gpu_pointer
MiniMatrix
MiniVector
preconditioner_factory_gpu
primary_variables_gpu
solver_adapter
throw_macros_on_gpu
)
if(TEST ${test})
set_tests_properties(${test}
PROPERTIES
LABELS
${gpu_label}
)
endif()
endforeach()
endif()
if(USE_GPU_BRIDGE)
@@ -408,6 +397,10 @@ macro(opm-simulators_targets_hook)
if(CONVERT_CUDA_TO_HIP)
target_link_libraries(opmsimulators PUBLIC roc::hipblas roc::hipsparse)
endif()
if(USE_GPU_BRIDGE AND hip_FOUND)
target_link_libraries(opmsimulators PUBLIC roc::rocalution)
endif()
endmacro()
macro(opm-simulators_install_hook)
@@ -860,19 +853,7 @@ if(USE_GPU_BRIDGE)
target_link_libraries( opmsimulators PUBLIC ${OpenCL_LIBRARIES} )
endif()
if(ROCALUTION_FOUND)
set_tests_properties(rocalutionSolver PROPERTIES LABELS gpu_rocm)
endif()
if(rocsparse_FOUND AND rocblas_FOUND)
set_tests_properties(rocsparseSolver PROPERTIES LABELS gpu_rocm)
endif()
if(VexCL_FOUND)
target_link_libraries( opmsimulators PUBLIC OPM::VexCL::OpenCL )
endif()
endif()
if(USE_DAMARIS_LIB AND Damaris_FOUND)
target_link_libraries(opmsimulators PUBLIC damaris)
endif()
+1 -1
View File
@@ -32,7 +32,7 @@ macro (ADD_CUDA_OR_HIP_FILE LIST DIR FILE)
if(CUDA_FOUND)
list (APPEND ${LIST} "${DIR}/gpuistl/${FILE}")
else()
elseif(CONVERT_CUDA_TO_HIP)
# we must hipify the code
# and include the correct path which is in the build/binary dir
string(REPLACE ".cu" ".hip" HIP_SOURCE_FILE ${FILE})
@@ -39,8 +39,8 @@
#include <opm/simulators/linalg/gpubridge/rocm/rocalutionSolverBackend.hpp>
#include <rocalution.hpp>
#include <base/matrix_formats_ind.hpp> // check if blocks are interpreted as row-major or column-major
#include <rocalution/rocalution.hpp>
#include <rocalution/base/matrix_formats_ind.hpp> // check if blocks are interpreted as row-major or column-major
#ifdef HIP_HAVE_CUDA_DEFINED
#define HAVE_CUDA HIP_HAVE_CUDA_DEFINED
+1 -1
View File
@@ -25,7 +25,7 @@
#include <opm/simulators/linalg/gpubridge/GpuBridge.hpp>
#include <opm/simulators/linalg/gpubridge/WellContributions.hpp>
#include <rocalution.hpp>
#include <rocalution/rocalution.hpp>
#include <dune/common/fvector.hh>
#include <dune/istl/bvector.hh>