]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix flags for Trilinos+Kokkos
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 16 Nov 2022 17:31:53 +0000 (17:31 +0000)
committerDaniel Arndt <arndtd@ornl.gov>
Sat, 19 Nov 2022 00:57:09 +0000 (18:57 -0600)
cmake/configure/configure_20_trilinos.cmake
cmake/modules/FindTRILINOS.cmake

index 6adaf536cb6be60126642574af207f3a9a0a73c9..ff05196e960a655b4e11acdb2148e248e2ab83a8 100644 (file)
@@ -177,12 +177,7 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
     ENDIF()
 
     IF(DEAL_II_TRILINOS_WITH_KOKKOS)
-      CHECK_SYMBOL_EXISTS(
-        "KOKKOS_ENABLE_CUDA"
-        "Kokkos_Macros.hpp"
-        DEAL_II_KOKKOS_CUDA_EXISTS
-        )
-      IF(DEAL_II_KOKKOS_CUDA_EXISTS)
+      IF(Kokkos_ENABLE_CUDA)
         # We need to disable SIMD vectorization for CUDA device code.
         # Otherwise, nvcc compilers from version 9 on will emit an error message like:
         # "[...] contains a vector, which is not supported in device code". We
@@ -191,25 +186,10 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
         SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0)
       ENDIF()
 
-      CHECK_SYMBOL_EXISTS(
-        "KOKKOS_ENABLE_CUDA_LAMBDA"
-        "Kokkos_Macros.hpp"
-        DEAL_II_KOKKOS_LAMBDA_EXISTS
-        )
-      IF(DEAL_II_KOKKOS_LAMBDA_EXISTS)
-        ADD_FLAGS(CMAKE_REQUIRED_FLAGS "--expt-extended-lambda")
-      ENDIF()
-
       # We need a recent version of Trilinos to use kokkos_check. We want to use
       # VERSION_GREATER_EQUAL 13.0 but this requires CMake 3.7
-      IF(TRILINOS_VERSION VERSION_GREATER 12.99)
-        SET(KOKKOS_WITH_OPENMP "")
-        kokkos_check(DEVICES OpenMP RETURN_VALUE KOKKOS_WITH_OPENMP)
-        IF(KOKKOS_WITH_OPENMP)
-          FIND_PACKAGE(OpenMP REQUIRED)
-          ADD_FLAGS(DEAL_II_CXX_FLAGS "${OpenMP_CXX_FLAGS}")
-          ADD_FLAGS(DEAL_II_LINKER_FLAGS "${OpenMP_CXX_FLAGS}")
-        ENDIF()
+      IF(TRILINOS_VERSION VERSION_GREATER 12.99 AND Kokkos_ENABLE_CUDA)
+        KOKKOS_CHECK(OPTIONS CUDA_LAMBDA)
       ENDIF()
     ENDIF()
 
index 2caef12839b1823c42aadbcb26e7180d74f89304..c5e29605881eb44e853a7fee20bcd53fde4e6d90 100644 (file)
@@ -159,6 +159,8 @@ DEAL_II_PACKAGE_HANDLE(TRILINOS
   USER_INCLUDE_DIRS
     REQUIRED Trilinos_INCLUDE_DIRS
     OPTIONAL Trilinos_TPL_INCLUDE_DIRS
+  CXX_FLAGS
+    OPTIONAL Trilinos_CXX_COMPILER_FLAGS
   LINKER_FLAGS
     OPTIONAL Trilinos_EXTRA_LD_FLAGS
   CLEAR

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.