diff --git a/cmake/SetupBOUTThirdParty.cmake b/cmake/SetupBOUTThirdParty.cmake index abe50913b2..d6d3f18b1e 100644 --- a/cmake/SetupBOUTThirdParty.cmake +++ b/cmake/SetupBOUTThirdParty.cmake @@ -25,6 +25,13 @@ if(BOUT_HAS_CUDA) # NOTE: CUDA inherits the CXX standard setting from the top-level # compile features, set for the bout++ target. set_source_files_properties(${BOUT_SOURCES_CXX} PROPERTIES LANGUAGE CUDA) + + # timer.cxx contains no device code, and compiling its C++20 formatting and + # ranges machinery with cudafe++ is pathologically slow with CUDA 12.9. + set_source_files_properties( + ${PROJECT_SOURCE_DIR}/src/sys/timer.cxx PROPERTIES LANGUAGE CXX + ) + find_package(CUDAToolkit) set_target_properties(bout++ PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(bout++ PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/include/bout/fieldops.hxx b/include/bout/fieldops.hxx index 47cf6f8be8..a6f82a9970 100644 --- a/include/bout/fieldops.hxx +++ b/include/bout/fieldops.hxx @@ -474,7 +474,7 @@ struct BinaryExpr { this->div = div; return *this; } - BOUT_HOST_DEVICE BOUT_FORCEINLINE bool hasParallelSlices() const { + BOUT_FORCEINLINE bool hasParallelSlices() const { if constexpr (is_expr_constant_v && is_expr_constant_v) { return false; } else if constexpr (is_expr_constant_v) { @@ -485,7 +485,7 @@ struct BinaryExpr { return lhs.hasParallelSlices() && rhs.hasParallelSlices(); } } - BOUT_HOST_DEVICE BOUT_FORCEINLINE int numberParallelSlices() const { + BOUT_FORCEINLINE int numberParallelSlices() const { if (!hasParallelSlices()) { return 0; } diff --git a/src/mesh/parallel/shiftedmetric.cxx b/src/mesh/parallel/shiftedmetric.cxx index ec8e19cc12..17b62257f4 100644 --- a/src/mesh/parallel/shiftedmetric.cxx +++ b/src/mesh/parallel/shiftedmetric.cxx @@ -440,7 +440,6 @@ static void shiftZ_block_fft(const int Nz, const BoutReal** in, BoutReal** out, fft_block_cooperative<32, FFTS_PER_BLOCK> <<>>(in, out, phs, nbatches, nblocks); - } else if (Nz == 64) { constexpr int FFTS_PER_BLOCK = 4; constexpr int THREADS_PER_FFT = 64; diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 60a5524c20..bb8a434761 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -67,7 +67,6 @@ set(serial_tests_source ./field/test_vector3d.cxx ./field/test_where.cxx ./include/bout/test_array.cxx - ./include/bout/test_rajalib.cxx ./include/bout/test_assert.cxx ./include/bout/test_bout_enum_class.cxx ./include/bout/test_boundary_iter.cxx @@ -138,6 +137,10 @@ if(BOUT_HAS_HYPRE) list(APPEND serial_tests_source ./invert/laplace/test_laplace_hypre3d.cxx) endif() +if(BOUT_HAS_RAJA) + list(APPEND serial_tests_source ./include/bout/test_rajalib.cxx) +endif() + add_executable(serial_tests ${serial_tests_source}) target_include_directories(