Skip to content

Commit d4b7676

Browse files
committed
tpetra: detect presence of KokkosComm package
Signed-off-by: Carl Pearson <cwpears@sandia.gov>
1 parent eca180c commit d4b7676

File tree

6 files changed

+47
-1
lines changed

6 files changed

+47
-1
lines changed

packages/tpetra/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,21 @@ IF (NOT DEFINED ${PACKAGE_NAME}_ENABLE_mpi_advance)
816816
ENDIF ()
817817
ASSERT_DEFINED (${PACKAGE_NAME}_ENABLE_mpi_advance)
818818

819+
# ============================================================
820+
# Kokkos Comm
821+
# ============================================================
822+
823+
IF (NOT DEFINED ${PACKAGE_NAME}_ENABLE_KokkosComm)
824+
IF (DEFINED TpetraCore_ENABLE_KokkosComm)
825+
SET (${PACKAGE_NAME}_ENABLE_KokkosComm "${TpetraCore_ENABLE_KokkosComm}")
826+
ELSEIF (DEFINED TPL_ENABLE_KokkosComm)
827+
SET (${PACKAGE_NAME}_ENABLE_KokkosComm "${TPL_ENABLE_KokkosComm}")
828+
ELSE ()
829+
SET (${PACKAGE_NAME}_ENABLE_KokkosComm OFF)
830+
ENDIF ()
831+
ENDIF ()
832+
ASSERT_DEFINED (${PACKAGE_NAME}_ENABLE_KokkosComm)
833+
819834
# ============================================================
820835
# Scalar types
821836
# ============================================================
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
22
LIB_REQUIRED_PACKAGES Teuchos Kokkos TeuchosKokkosCompat TeuchosKokkosComm KokkosKernels
3-
LIB_OPTIONAL_PACKAGES Epetra TpetraTSQR TeuchosNumerics
3+
LIB_OPTIONAL_PACKAGES Epetra TpetraTSQR TeuchosNumerics KokkosComm
44
LIB_OPTIONAL_TPLS MPI CUDA QD quadmath mpi_advance
55
)

packages/tpetra/core/cmake/TpetraCore_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
/* Determine if we have the mpi_advance TPL */
3535
#cmakedefine HAVE_TPETRACORE_MPI_ADVANCE
3636

37+
/* Determine if we have the KokkosComm TPL */
38+
#cmakedefine HAVE_TPETRACORE_KOKKOSCOMM
39+
3740
/* Determine if we have QD */
3841
#cmakedefine HAVE_TPETRACORE_QD
3942
#ifdef HAVE_TPETRACORE_QD

packages/tpetra/core/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ADD_SUBDIRECTORIES(
2222
ImportExport
2323
ImportExport2
2424
inout
25+
KokkosComm
2526
LinearProblem
2627
Map
2728
MatrixMatrix
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR})
2+
3+
IF (${PACKAGE_NAME}_ENABLE_KokkosComm)
4+
5+
TRIBITS_ADD_EXECUTABLE_AND_TEST(
6+
KokkosComm_include
7+
SOURCES
8+
KokkosComm_include.cpp
9+
STANDARD_PASS_OUTPUT
10+
)
11+
12+
ENDIF()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @HEADER
2+
// *****************************************************************************
3+
// Tpetra: Templated Linear Algebra Services Package
4+
//
5+
// Copyright 2008 NTESS and the Tpetra contributors.
6+
// SPDX-License-Identifier: BSD-3-Clause
7+
// *****************************************************************************
8+
// @HEADER
9+
10+
#include <KokkosComm/KokkosComm.hpp>
11+
12+
int main(int argc, char* argv[])
13+
{
14+
return 0;
15+
}

0 commit comments

Comments
 (0)