From 9cef2a76719dbdb6194a49c584d71d55a95ff470 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 1 Dec 2023 15:39:08 +0000 Subject: [PATCH 1/3] Don't let Kokkos set CMAKE_CXX_FLAGS --- packages/kokkos/CMakeLists.txt | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/packages/kokkos/CMakeLists.txt b/packages/kokkos/CMakeLists.txt index f6bd81058e90..b0a37a9d4458 100644 --- a/packages/kokkos/CMakeLists.txt +++ b/packages/kokkos/CMakeLists.txt @@ -252,7 +252,6 @@ ENDIF() # subpackages ## This restores the old behavior of ProjectCompilerPostConfig.cmake -# It sets the CMAKE_CXX_FLAGS globally to those used by Kokkos # We must do this before KOKKOS_PACKAGE_DECL IF (KOKKOS_HAS_TRILINOS) # Overwrite the old flags at the top-level @@ -280,21 +279,6 @@ IF (KOKKOS_HAS_TRILINOS) SET(KOKKOSCORE_XCOMPILER_OPTIONS "${KOKKOSCORE_XCOMPILER_OPTIONS} -Xcompiler ${XCOMP_FLAG}") LIST(APPEND KOKKOS_ALL_COMPILE_OPTIONS -Xcompiler ${XCOMP_FLAG}) ENDFOREACH() - SET(KOKKOSCORE_CXX_FLAGS "${KOKKOSCORE_COMPILE_OPTIONS} ${KOKKOSCORE_XCOMPILER_OPTIONS}") - IF (KOKKOS_ENABLE_CUDA) - STRING(REPLACE ";" " " KOKKOSCORE_CUDA_OPTIONS "${KOKKOS_CUDA_OPTIONS}") - FOREACH(CUDAFE_FLAG ${KOKKOS_CUDAFE_OPTIONS}) - SET(KOKKOSCORE_CUDAFE_OPTIONS "${KOKKOSCORE_CUDAFE_OPTIONS} -Xcudafe ${CUDAFE_FLAG}") - LIST(APPEND KOKKOS_ALL_COMPILE_OPTIONS -Xcudafe ${CUDAFE_FLAG}) - ENDFOREACH() - SET(KOKKOSCORE_CXX_FLAGS "${KOKKOSCORE_CXX_FLAGS} ${KOKKOSCORE_CUDA_OPTIONS} ${KOKKOSCORE_CUDAFE_OPTIONS}") - ENDIF() - # Both parent scope and this package - # In ProjectCompilerPostConfig.cmake, we capture the "global" flags Trilinos wants in - # TRILINOS_TOPLEVEL_CXX_FLAGS - SET(CMAKE_CXX_FLAGS "${TRILINOS_TOPLEVEL_CXX_FLAGS} ${KOKKOSCORE_CXX_FLAGS}" PARENT_SCOPE) - SET(CMAKE_CXX_FLAGS "${TRILINOS_TOPLEVEL_CXX_FLAGS} ${KOKKOSCORE_CXX_FLAGS}") - #CMAKE_CXX_FLAGS will get added to Kokkos and Kokkos dependencies automatically here #These flags get set up in KOKKOS_PACKAGE_DECL, which means they #must be configured before KOKKOS_PACKAGE_DECL SET(KOKKOS_ALL_COMPILE_OPTIONS From 537022cbe190af377992d5ead77523530ee7ecb9 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 24 Jan 2024 07:51:33 -0500 Subject: [PATCH 2/3] Still add KOKKOS_CUDA_FE_OPTIONS to KOKKOS_ALL_COMPILE_OPTIONS --- packages/kokkos/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/kokkos/CMakeLists.txt b/packages/kokkos/CMakeLists.txt index b0a37a9d4458..f5aed715f886 100644 --- a/packages/kokkos/CMakeLists.txt +++ b/packages/kokkos/CMakeLists.txt @@ -279,6 +279,13 @@ IF (KOKKOS_HAS_TRILINOS) SET(KOKKOSCORE_XCOMPILER_OPTIONS "${KOKKOSCORE_XCOMPILER_OPTIONS} -Xcompiler ${XCOMP_FLAG}") LIST(APPEND KOKKOS_ALL_COMPILE_OPTIONS -Xcompiler ${XCOMP_FLAG}) ENDFOREACH() + IF (KOKKOS_ENABLE_CUDA) + STRING(REPLACE ";" " " KOKKOSCORE_CUDA_OPTIONS "${KOKKOS_CUDA_OPTIONS}") + FOREACH(CUDAFE_FLAG ${KOKKOS_CUDAFE_OPTIONS}) + SET(KOKKOSCORE_CUDAFE_OPTIONS "${KOKKOSCORE_CUDAFE_OPTIONS} -Xcudafe ${CUDAFE_FLAG}") + LIST(APPEND KOKKOS_ALL_COMPILE_OPTIONS -Xcudafe ${CUDAFE_FLAG}) + ENDFOREACH() + ENDIF() #These flags get set up in KOKKOS_PACKAGE_DECL, which means they #must be configured before KOKKOS_PACKAGE_DECL SET(KOKKOS_ALL_COMPILE_OPTIONS From 84fdfd561efb358a5aa3621a1f30ecd79e661e0f Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 25 Jan 2024 08:42:33 -0500 Subject: [PATCH 3/3] Cherry-pick kokkos/kokkos#6510 --- packages/kokkos/simd/src/Kokkos_SIMD_Scalar.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/kokkos/simd/src/Kokkos_SIMD_Scalar.hpp b/packages/kokkos/simd/src/Kokkos_SIMD_Scalar.hpp index af7cb1e2c616..7443f5596b5e 100644 --- a/packages/kokkos/simd/src/Kokkos_SIMD_Scalar.hpp +++ b/packages/kokkos/simd/src/Kokkos_SIMD_Scalar.hpp @@ -224,7 +224,7 @@ template using data_type = std::conditional_t, T, double>; return Experimental::simd( Kokkos::floor(static_cast(a[0]))); -}; +} template [[nodiscard]] KOKKOS_FORCEINLINE_FUNCTION auto ceil( @@ -232,7 +232,7 @@ template using data_type = std::conditional_t, T, double>; return Experimental::simd( Kokkos::ceil(static_cast(a[0]))); -}; +} template [[nodiscard]] KOKKOS_FORCEINLINE_FUNCTION auto round( @@ -240,7 +240,7 @@ template using data_type = std::conditional_t, T, double>; return Experimental::simd( Experimental::round_half_to_nearest_even(static_cast(a[0]))); -}; +} template [[nodiscard]] KOKKOS_FORCEINLINE_FUNCTION auto trunc( @@ -248,7 +248,7 @@ template using data_type = std::conditional_t, T, double>; return Experimental::simd( Kokkos::trunc(static_cast(a[0]))); -}; +} template [[nodiscard]] KOKKOS_FORCEINLINE_FUNCTION