From: Daniel Arndt Date: Wed, 16 Nov 2022 17:31:53 +0000 (+0000) Subject: Fix flags for Trilinos+Kokkos X-Git-Tag: v9.5.0-rc1~828^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8f36ef7d0ff93d7c84894e9fa9fecaaa20a2f0e;p=dealii.git Fix flags for Trilinos+Kokkos --- diff --git a/cmake/configure/configure_20_trilinos.cmake b/cmake/configure/configure_20_trilinos.cmake index 6adaf536cb..ff05196e96 100644 --- a/cmake/configure/configure_20_trilinos.cmake +++ b/cmake/configure/configure_20_trilinos.cmake @@ -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() diff --git a/cmake/modules/FindTRILINOS.cmake b/cmake/modules/FindTRILINOS.cmake index 2caef12839..c5e2960588 100644 --- a/cmake/modules/FindTRILINOS.cmake +++ b/cmake/modules/FindTRILINOS.cmake @@ -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