From cbbe5c5c98158acca231ee8dd0811d9f02996149 Mon Sep 17 00:00:00 2001 From: Thomas Padioleau Date: Tue, 28 Jul 2026 10:39:04 +0200 Subject: [PATCH] Simplify testing, rely only the default backend of Kokkos --- tests/CMakeLists.txt | 19 ++++--------------- tests/gmgpolar_tests.cpp | 5 +---- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bd33facb1..9bc1585ab 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,19 +24,8 @@ set(gmgpolar_test_sources include(GoogleTest) -# Build the test suite twice: once for serial (1 thread) and once for parallel (16 threads). -# GMGPOLAR_TEST_THREADS is passed to Kokkos::InitializationSettings at startup. -foreach(label_threads "Serial;1" "Parallel;16") - list(GET label_threads 0 label) - list(GET label_threads 1 num_threads) - set(test_target gmgpolar_tests_${label}) +add_executable(gmgpolar_tests ${gmgpolar_test_sources}) +target_compile_features(gmgpolar_tests PRIVATE cxx_std_20) +target_link_libraries(gmgpolar_tests GMGPolarLib GMGPolarInterface GTest::gtest) - add_executable(${test_target} ${gmgpolar_test_sources}) - target_compile_features(${test_target} PRIVATE cxx_std_20) - target_compile_definitions(${test_target} PRIVATE GMGPOLAR_TEST_THREADS=${num_threads}) - target_link_libraries(${test_target} GMGPolarLib GMGPolarInterface GTest::gtest) - - gtest_discover_tests(${test_target} - TEST_PREFIX ${label} - DISCOVERY_MODE PRE_TEST) -endforeach() +gtest_discover_tests(gmgpolar_tests DISCOVERY_MODE PRE_TEST) diff --git a/tests/gmgpolar_tests.cpp b/tests/gmgpolar_tests.cpp index a39101503..0c0c1b3a4 100644 --- a/tests/gmgpolar_tests.cpp +++ b/tests/gmgpolar_tests.cpp @@ -4,10 +4,7 @@ // Define the main function only once int main(int argc, char* argv[]) { - Kokkos::InitializationSettings settings; - // 8 (CPU) threads - settings.set_num_threads(GMGPOLAR_TEST_THREADS); - Kokkos::ScopeGuard kokkos_scope(settings); + Kokkos::ScopeGuard kokkos_scope(argc, argv); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }