From 1ada0fe97d035a990d6247c8ffdcb5a111ee50d7 Mon Sep 17 00:00:00 2001 From: Gilles Grospellier Date: Tue, 26 Nov 2024 11:07:21 +0100 Subject: [PATCH 1/2] [config] Add test using accelerator API but with sequential runtime. The tests using accelerator runtime are renamed and suffixed with the name of the accelerator runtime (for example '_cuda' with cuda). --- cmake/Utils.cmake | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake index 9eaad4ea..a8919bd6 100644 --- a/cmake/Utils.cmake +++ b/cmake/Utils.cmake @@ -27,14 +27,24 @@ macro(arcanefem_add_gpu_test) if (NOT ARGS_COMMAND) message(FATAL_ERROR "No arg COMMAND for macro 'arcanefem_add_gpu_test'") endif() + # Add test without accelerator Runtime + if (ARGS_NB_MPI) + if (MPIEXEC_EXECUTABLE) + add_test(NAME ${ARGS_NAME} COMMAND ${MPIEXEC_EXECUTABLE} -n ${ARGS_NB_MPI} ${ARGS_COMMAND} ${ARGS_ARGS}) + endif() + else() + add_test(NAME ${ARGS_NAME} COMMAND ${ARGS_COMMAND} ${ARGS_ARGS}) + endif() + + # Add test WITH accelerator Runtime if(ARCANE_HAS_ACCELERATOR) set(_RUNTIME_ARGS "-A,AcceleratorRuntime=${ARCANE_ACCELERATOR_RUNTIME}") if (ARGS_NB_MPI) if (MPIEXEC_EXECUTABLE) - add_test(NAME ${ARGS_NAME} COMMAND ${MPIEXEC_EXECUTABLE} -n ${ARGS_NB_MPI} ${ARGS_COMMAND} ${_RUNTIME_ARGS} ${ARGS_ARGS}) + add_test(NAME ${ARGS_NAME}_${ARCANE_ACCELERATOR_RUNTIME} COMMAND ${MPIEXEC_EXECUTABLE} -n ${ARGS_NB_MPI} ${ARGS_COMMAND} ${_RUNTIME_ARGS} ${ARGS_ARGS}) endif() else() - add_test(NAME ${ARGS_NAME} COMMAND ${ARGS_COMMAND} ${_RUNTIME_ARGS} ${ARGS_ARGS}) + add_test(NAME ${ARGS_NAME}_${ARCANE_ACCELERATOR_RUNTIME} COMMAND ${ARGS_COMMAND} ${_RUNTIME_ARGS} ${ARGS_ARGS}) endif() endif() endmacro() From 62a7e5b64e0e2dd78ab274fe76191a919f26ef91 Mon Sep 17 00:00:00 2001 From: Gilles Grospellier Date: Tue, 26 Nov 2024 11:34:53 +0100 Subject: [PATCH 2/2] [poisson] Allow using CSR format even if no accelerator is available. --- poisson/FemModule.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/poisson/FemModule.cc b/poisson/FemModule.cc index a8c8a9eb..7b68dcc0 100644 --- a/poisson/FemModule.cc +++ b/poisson/FemModule.cc @@ -183,13 +183,11 @@ _handleFlags() m_use_legacy = false; info() << "CSR: The CSR datastructure and its associated methods will be used"; } -#ifdef ARCANE_HAS_ACCELERATOR if (parameter_list.getParameterOrNull("CSR_GPU") == "TRUE" || options()->csrGpu()) { m_use_csr_gpu = true; m_use_legacy = false; info() << "CSR_GPU: The CSR datastructure GPU compatible and its associated methods will be used"; } -#endif if (parameter_list.getParameterOrNull("NWCSR") == "TRUE" || options()->nwcsr()) { m_use_nodewise_csr = true; m_use_legacy = false;