Skip to content

Commit

Permalink
Kokkos: Remove TriBITS Kokkos subpackages (trilinos/Trilinos#11545) (k…
Browse files Browse the repository at this point in the history
…okkos#6104)

* Kokkos: Remove TriBITS subpackages (#11545)

* Removed the listing of subpackages from kokkos/cmake/Dependencies.cmake

* Remove the now-unused files
  kokkos/[core,containers,algorithms,simd]/cmake/Dependencies.cmake

* Removed TriBITS macros for a package with subpackages and replace with those
  for a package with no subpackages.  Also, removed all subpackage macros.

* Changed kokkos_process_subpackage() to just call add_subdirectory().

* Added prefix 'Core' to several tests in
  kokkos/Core/unit_tests/CMakeLists.txt now that prefix is 'Kokkos_'

* Added prefix 'Containers' to several tests in
  kokkos/containers/unit_tests/CMakeLists.txt and
  kokkos/containers/performance_tests/CMakeLists.txt now that prefix is
  'Kokkos_'

* Change name of the kokkos/containers/performance_tests/CMakeLists.txt file
  test 'PerformanceTest_XXX' to 'ContainersPerformanceTest_XXX'.

* Added prefix 'Algorithms' to several tests in
  kokkos/algorithms/unit_tests/CMakeLists.txt now that prefix is 'Kokkos_'

* Removed the usage of tribits_configure_file() and wrapper
  kokkos_configure_file() and just call configure_file().  The location of
  PACKAGE_SORUCE_DIR changed so the calls to tribits_configure_file() no
  longer worked.  (Also, these X_config.h.in files were not using any of the
  TriBITS-supported features that needed the calling of
  tribits_configure_file() so there was no reason to not just call raw
  configure_file().)

SQUASH AGINST: Kokkos: Remove TriBITS subpackages (#11545)

* Fix native build of Kokkos after removing subpackages (trilinos/Trilinos#11545)

This restores the building of the raw CMake build of Kokkos after the
refactoring to remove TriBITS subpackages.

* Kokkos: Remove last of subpackage stuff, fix for tests enable (trilinos/Trilinos#11545)

This gives a full passing build and tests with the Trilinos PR GenConfig
clang-11.0.1 build configuration.

* Fixup update target name in python test script that gets configured

---------

Co-authored-by: Damien L-G <dalg24@gmail.com>
  • Loading branch information
bartlettroscoe and dalg24 committed May 5, 2023
1 parent edf63b3 commit 5fa72b5
Show file tree
Hide file tree
Showing 20 changed files with 88 additions and 201 deletions.
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ if( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" )
message( FATAL_ERROR "FATAL: In-source builds are not allowed. You should create a separate directory for build files and delete CMakeCache.txt." )
endif()

if (COMMAND TRIBITS_PACKAGE_DECL)
TRIBITS_PACKAGE_DECL(Kokkos)
if (COMMAND TRIBITS_PACKAGE)
TRIBITS_PACKAGE(Kokkos)
endif()

# We want to determine if options are given with the wrong case
Expand Down Expand Up @@ -37,6 +37,8 @@ IF(COMMAND TRIBITS_PACKAGE_DECL)
SET(KOKKOS_HAS_TRILINOS ON)
ELSE()
SET(KOKKOS_HAS_TRILINOS OFF)
SET(PACKAGE_NAME Kokkos)
SET(PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
ENDIF()
# Is this build a subdirectory of another project
GET_DIRECTORY_PROPERTY(HAS_PARENT PARENT_DIRECTORY)
Expand Down Expand Up @@ -299,10 +301,6 @@ IF (KOKKOS_HAS_TRILINOS)
$<$<COMPILE_LANGUAGE:CXX>:${KOKKOS_ALL_COMPILE_OPTIONS}>)
ENDIF()

if (NOT COMMAND TRIBITS_PACKAGE_DECL)
KOKKOS_PACKAGE_DECL()
endif()


#------------------------------------------------------------------------------
#
Expand All @@ -316,7 +314,6 @@ KOKKOS_PROCESS_SUBPACKAGES()
# E) If Kokkos itself is enabled, process the Kokkos package
#

KOKKOS_PACKAGE_DEF()
KOKKOS_EXCLUDE_AUTOTOOLS_FILES()
KOKKOS_PACKAGE_POSTPROCESS()
KOKKOS_CONFIGURE_CORE()
Expand Down
8 changes: 0 additions & 8 deletions algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@


KOKKOS_SUBPACKAGE(Algorithms)

IF (NOT Kokkos_INSTALL_TESTING)
ADD_SUBDIRECTORY(src)
ENDIF()
# FIXME_OPENACC: temporarily disabled due to unimplemented features
IF(NOT ((KOKKOS_ENABLE_OPENMPTARGET OR KOKKOS_ENABLE_OPENACC) AND KOKKOS_CXX_COMPILER_ID STREQUAL NVHPC))
KOKKOS_ADD_TEST_DIRECTORIES(unit_tests)
ENDIF()

KOKKOS_SUBPACKAGE_POSTPROCESS()


5 changes: 0 additions & 5 deletions algorithms/cmake/Dependencies.cmake

This file was deleted.

7 changes: 4 additions & 3 deletions algorithms/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

KOKKOS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h)
CONFIGURE_FILE(
${PACKAGE_SOURCE_DIR}/algorithms/cmake/KokkosAlgorithms_config.h.in
${CMAKE_CURRENT_BINARY_DIR}/KokkosAlgorithms_config.h )

#I have to leave these here for tribits
KOKKOS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
Expand All @@ -9,7 +10,7 @@ KOKKOS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

FILE(GLOB ALGO_HEADERS *.hpp)
FILE(GLOB ALGO_SOURCES *.cpp)
LIST(APPEND ALGO_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h)
LIST(APPEND ALGO_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/KokkosAlgorithms_config.h)
APPEND_GLOB(ALGO_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/std_algorithms/*.hpp)
APPEND_GLOB(ALGO_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/std_algorithms/impl/*.hpp)

Expand Down
6 changes: 3 additions & 3 deletions algorithms/unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ endif()
# when compiling for Intel's Xe-HP GPUs.
if(NOT (KOKKOS_ENABLE_OPENMPTARGET AND KOKKOS_CXX_COMPILER_ID STREQUAL IntelLLVM))
KOKKOS_ADD_EXECUTABLE_AND_TEST(
UnitTest_RandomAndSort
AlgorithmsUnitTest_RandomAndSort
SOURCES
UnitTestMain.cpp
${SOURCES_A}
Expand All @@ -173,7 +173,7 @@ endif()

foreach(ID A;B;C;D;E)
KOKKOS_ADD_EXECUTABLE_AND_TEST(
UnitTest_StdSet_${ID}
AlgorithmsUnitTest_StdSet_${ID}
SOURCES
UnitTestMain.cpp
${STDALGO_SOURCES_${ID}}
Expand All @@ -184,7 +184,7 @@ endforeach()
# when compiling for Intel's Xe-HP GPUs.
if(NOT (KOKKOS_ENABLE_OPENMPTARGET AND KOKKOS_CXX_COMPILER_ID STREQUAL IntelLLVM))
KOKKOS_ADD_EXECUTABLE(
UnitTest_StdAlgoCompileOnly
AlgorithmsUnitTest_StdAlgoCompileOnly
SOURCES TestStdAlgorithmsCompileOnly.cpp
)
endif()
12 changes: 4 additions & 8 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS
#SubPackageName Directory Class Req/Opt
#
# New Kokkos subpackages:
Core core PS REQUIRED
Containers containers PS OPTIONAL
Algorithms algorithms PS OPTIONAL
Simd simd PT OPTIONAL
LIB_OPTIONAL_TPLS Pthread CUDA HWLOC DLlib
TEST_OPTIONAL_TPLS CUSPARSE
)

TRIBITS_TPL_TENTATIVELY_ENABLE(DLlib)
13 changes: 0 additions & 13 deletions cmake/fake_tribits.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,6 @@ MACRO(PREPEND_TARGET_SET VARNAME TARGET_NAME TYPE)
ENDMACRO()
endif()


FUNCTION(KOKKOS_CONFIGURE_FILE PACKAGE_NAME_CONFIG_FILE)
if (KOKKOS_HAS_TRILINOS)
TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME_CONFIG_FILE})
else()
# Configure the file
CONFIGURE_FILE(
${PACKAGE_SOURCE_DIR}/cmake/${PACKAGE_NAME_CONFIG_FILE}.in
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME_CONFIG_FILE}
)
endif()
ENDFUNCTION()

MACRO(ADD_INTERFACE_LIBRARY LIB_NAME)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "")
ADD_LIBRARY(${LIB_NAME} STATIC ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
Expand Down
51 changes: 5 additions & 46 deletions cmake/kokkos_tribits.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,53 +44,12 @@ IF (KOKKOS_HAS_TRILINOS)
ENDIF()
ENDIF()

MACRO(KOKKOS_SUBPACKAGE NAME)
if (KOKKOS_HAS_TRILINOS)
TRIBITS_SUBPACKAGE(${NAME})
else()
SET(PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
SET(PARENT_PACKAGE_NAME ${PACKAGE_NAME})
SET(PACKAGE_NAME ${PACKAGE_NAME}${NAME})
STRING(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UC)
SET(${PACKAGE_NAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
#ADD_INTERFACE_LIBRARY(PACKAGE_${PACKAGE_NAME})
#GLOBAL_SET(${PACKAGE_NAME}_LIBS "")
endif()
ENDMACRO()

MACRO(KOKKOS_SUBPACKAGE_POSTPROCESS)
if (KOKKOS_HAS_TRILINOS)
TRIBITS_SUBPACKAGE_POSTPROCESS()
endif()
ENDMACRO()

MACRO(KOKKOS_PACKAGE_DECL)

if (KOKKOS_HAS_TRILINOS)
TRIBITS_PACKAGE_DECL(Kokkos)
else()
SET(PACKAGE_NAME Kokkos)
SET(${PACKAGE_NAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
STRING(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UC)
endif()

#SET(TRIBITS_DEPS_DIR "${CMAKE_SOURCE_DIR}/cmake/deps")
#FILE(GLOB TPLS_FILES "${TRIBITS_DEPS_DIR}/*.cmake")
#FOREACH(TPL_FILE ${TPLS_FILES})
# TRIBITS_PROCESS_TPL_DEP_FILE(${TPL_FILE})
#ENDFOREACH()

ENDMACRO()


MACRO(KOKKOS_PROCESS_SUBPACKAGES)
if (KOKKOS_HAS_TRILINOS)
TRIBITS_PROCESS_SUBPACKAGES()
else()
ADD_SUBDIRECTORY(core)
ADD_SUBDIRECTORY(containers)
ADD_SUBDIRECTORY(algorithms)
ADD_SUBDIRECTORY(simd)
ADD_SUBDIRECTORY(core)
ADD_SUBDIRECTORY(containers)
ADD_SUBDIRECTORY(algorithms)
ADD_SUBDIRECTORY(simd)
if (NOT KOKKOS_HAS_TRILINOS)
ADD_SUBDIRECTORY(example)
endif()
ENDMACRO()
Expand Down
6 changes: 0 additions & 6 deletions containers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@


KOKKOS_SUBPACKAGE(Containers)

IF (NOT Kokkos_INSTALL_TESTING)
ADD_SUBDIRECTORY(src)
ENDIF()
Expand All @@ -11,5 +7,3 @@ IF(NOT KOKKOS_ENABLE_OPENACC)
KOKKOS_ADD_TEST_DIRECTORIES(unit_tests)
KOKKOS_ADD_TEST_DIRECTORIES(performance_tests)
ENDIF()

KOKKOS_SUBPACKAGE_POSTPROCESS()
5 changes: 0 additions & 5 deletions containers/cmake/Dependencies.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion containers/performance_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ foreach(Tag Threads;OpenMP;Cuda;HPX;HIP)
)

KOKKOS_ADD_EXECUTABLE_AND_TEST(
PerformanceTest_${Tag}
ContainersPerformanceTest_${Tag}
SOURCES ${SOURCES}
)
endif()
Expand Down
5 changes: 3 additions & 2 deletions containers/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

KOKKOS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h)
CONFIGURE_FILE(
${PACKAGE_SOURCE_DIR}/containers/cmake/KokkosContainers_config.h.in
${CMAKE_CURRENT_BINARY_DIR}/KokkosContainers_config.h )

#need these here for now
KOKKOS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
Expand Down
4 changes: 2 additions & 2 deletions containers/unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ foreach(Tag Threads;Serial;OpenMP;HPX;Cuda;HIP;SYCL)
LIST(REMOVE_ITEM UnitTestSources ${dir}/TestCuda_DynViewAPI_generic.cpp)
endif()

KOKKOS_ADD_EXECUTABLE_AND_TEST(UnitTest_${Tag} SOURCES ${UnitTestSources})
KOKKOS_ADD_EXECUTABLE_AND_TEST(ContainersUnitTest_${Tag} SOURCES ${UnitTestSources})
endif()
endforeach()

SET(COMPILE_ONLY_SOURCES
TestCreateMirror.cpp
)
KOKKOS_ADD_EXECUTABLE(
TestCompileOnly
ContainersTestCompileOnly
SOURCES
TestCompileMain.cpp
${COMPILE_ONLY_SOURCES}
Expand Down
6 changes: 0 additions & 6 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@


KOKKOS_SUBPACKAGE(Core)

IF (NOT Kokkos_INSTALL_TESTING)
ADD_SUBDIRECTORY(src)
ENDIF()
Expand All @@ -24,5 +20,3 @@ ENDFUNCTION()

KOKKOS_ADD_TEST_DIRECTORIES(unit_test)
KOKKOS_ADD_BENCHMARK_DIRECTORY(perf_test)

KOKKOS_SUBPACKAGE_POSTPROCESS()
6 changes: 0 additions & 6 deletions core/cmake/Dependencies.cmake

This file was deleted.

0 comments on commit 5fa72b5

Please sign in to comment.