From b40cdd8189e2041408c4a3439ff0f696c72cce8e Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 23 Aug 2023 12:14:45 -0400 Subject: [PATCH 1/3] Find Kokkos manually to fix compiling when Trilinos uses external Kokkos --- CMakeLists.txt | 13 ++++++++----- .../DTK_DetailsMovingLeastSquaresOperatorImpl.hpp | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e21bcd67..702d63f4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ IF (NOT TRIBITS_PROCESSING_PACKAGE) ## FLAGS ##---------------------------------------------------------------------------## - SET(CMAKE_CXX_STANDARD 14) + SET(CMAKE_CXX_STANDARD 17) ##---------------------------------------------------------------------------## ## TriBITS package processing @@ -60,10 +60,13 @@ ELSE() IF(${PACKAGE_NAME}_TRILINOS_TPL) LIST(APPEND CMAKE_PREFIX_PATH ${TPL_Trilinos_LIBRARY_DIRS}/.. /usr/local/cuda/lib64) + find_package(Kokkos REQUIRED QUIET) + # Find the available devices in Kokkos. FIND_PATH(_Kokkos_SETTINGS NAMES KokkosConfig.cmake PATHS ${KOKKOS_PREFIX} + ${Kokkos_DIR} ${TPL_Trilinos_LIBRARY_DIRS}/cmake/Kokkos ${Trilinos_DIR}/../Kokkos) INCLUDE(${_Kokkos_SETTINGS}/KokkosConfig.cmake) @@ -74,16 +77,16 @@ ELSE() SET(${PACKAGE_NAME}_ETI_LORDS "int") SET(${PACKAGE_NAME}_ETI_GORDS "long") SET(${PACKAGE_NAME}_ETI_NODES "") # start with the empty list - IF ("SERIAL" IN_LIST Kokkos_DEVICES) + IF (Kokkos_ENABLE_SERIAL) LIST(APPEND ${PACKAGE_NAME}_ETI_NODES "Kokkos::Compat::KokkosSerialWrapperNode") ENDIF() - IF ("OPENMP" IN_LIST Kokkos_DEVICES) + IF (Kokkos_ENABLE_OPENMP) LIST(APPEND ${PACKAGE_NAME}_ETI_NODES "Kokkos::Compat::KokkosOpenMPWrapperNode") ENDIF() - IF ("CUDA" IN_LIST Kokkos_DEVICES) + IF (Kokkos_ENABLE_CUDA) LIST(APPEND ${PACKAGE_NAME}_ETI_NODES "Kokkos::Compat::KokkosCudaWrapperNode") ENDIF() - IF("THREADS" IN_LIST Kokkos_DEVICES) + IF(Kokkos_ENABLE_THREADS) LIST(APPEND ${PACKAGE_NAME}_ETI_NODES "Kokkos::Compat::KokkosThreadsWrapperNode") ENDIF() ELSE() diff --git a/packages/Meshfree/src/DTK_DetailsMovingLeastSquaresOperatorImpl.hpp b/packages/Meshfree/src/DTK_DetailsMovingLeastSquaresOperatorImpl.hpp index 19b9e1747..a425dcb6a 100644 --- a/packages/Meshfree/src/DTK_DetailsMovingLeastSquaresOperatorImpl.hpp +++ b/packages/Meshfree/src/DTK_DetailsMovingLeastSquaresOperatorImpl.hpp @@ -122,7 +122,7 @@ struct MovingLeastSquaresOperatorImpl ArborX::Point{{source_points( j, 0 ), source_points( j, 1 ), source_points( j, 2 )}}, - ArborX::Point{{0., 0., 0.}} ); + ArborX::Point{0., 0., 0.} ); if ( new_distance > distance ) distance = new_distance; @@ -162,7 +162,7 @@ struct MovingLeastSquaresOperatorImpl phi( i ) = rbf( ArborX::Details::distance( ArborX::Point{{source_points( i, 0 ), source_points( i, 1 ), source_points( i, 2 )}}, - ArborX::Point{{0., 0., 0.}} ) ); + ArborX::Point{0., 0., 0.} ) ); } ); Kokkos::fence(); return phi; From 60388ba9391e7fb82f172266eb9929f58c93125c Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 23 Aug 2023 13:06:17 -0400 Subject: [PATCH 2/3] Don't try finding KokkosConfig.cmake --- CMakeLists.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 702d63f4f..428a9001a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,16 +62,6 @@ ELSE() find_package(Kokkos REQUIRED QUIET) - # Find the available devices in Kokkos. - FIND_PATH(_Kokkos_SETTINGS - NAMES KokkosConfig.cmake - PATHS ${KOKKOS_PREFIX} - ${Kokkos_DIR} - ${TPL_Trilinos_LIBRARY_DIRS}/cmake/Kokkos - ${Trilinos_DIR}/../Kokkos) - INCLUDE(${_Kokkos_SETTINGS}/KokkosConfig.cmake) - ASSERT_DEFINED(Kokkos_DEVICES) - # Hijack Tpetra ETI SET(${PACKAGE_NAME}_ETI_SCALARS "double") SET(${PACKAGE_NAME}_ETI_LORDS "int") From d3d9519b7aa13696ba7e7acc05dc329531b46f26 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 23 Aug 2023 15:19:30 -0400 Subject: [PATCH 3/3] Provide a hint to find Kokkos --- .gitmodules | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 5ba47baba..9a1e9787b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "data"] path = data - url = ../DTKData.git + url = https://github.com/ORNL-CEES/DTKData [submodule "arborx"] path = packages/Search url = ../../arborx/arborx.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 428a9001a..e4d237344 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ ELSE() IF(${PACKAGE_NAME}_TRILINOS_TPL) LIST(APPEND CMAKE_PREFIX_PATH ${TPL_Trilinos_LIBRARY_DIRS}/.. /usr/local/cuda/lib64) - find_package(Kokkos REQUIRED QUIET) + find_package(Kokkos REQUIRED QUIET HINTS ${Trilinos_DIR}/../Kokkos) # Hijack Tpetra ETI SET(${PACKAGE_NAME}_ETI_SCALARS "double")