Skip to content

Commit

Permalink
Fix diffs to release-3.1 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
crtrott committed Apr 16, 2020
1 parent bb24ccf commit c1afdf4
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 19 deletions.
3 changes: 3 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ Options can be enabled by specifying `-DKokkos_ENABLE_X`.
* Kokkos_ENABLE_DEPRECATED_CODE
* Whether to enable deprecated code
* BOOL Default: OFF
* Kokkos_ENABLE_EXAMPLES
* Whether to enable building examples
* BOOL Default: OFF
* Kokkos_ENABLE_HPX_ASYNC_DISPATCH
* Whether HPX supports asynchronous dispatch
* BOOL Default: OFF
Expand Down
16 changes: 6 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,14 @@ ENDIF()
# These are the variables we will append to as we go
# I really wish these were regular variables
# but scoping issues can make it difficult
GLOBAL_RESET(KOKKOS_COMPILE_OPTIONS)
GLOBAL_RESET(KOKKOS_LINK_OPTIONS)
GLOBAL_RESET(KOKKOS_CUDA_OPTIONS)
GLOBAL_RESET(KOKKOS_CUDAFE_OPTIONS)
GLOBAL_RESET(KOKKOS_XCOMPILER_OPTIONS)
GLOBAL_SET(KOKKOS_COMPILE_OPTIONS)
GLOBAL_SET(KOKKOS_LINK_OPTIONS)
GLOBAL_SET(KOKKOS_CUDA_OPTIONS)
GLOBAL_SET(KOKKOS_CUDAFE_OPTIONS)
GLOBAL_SET(KOKKOS_XCOMPILER_OPTIONS)
# We need to append text here for making sure TPLs
# we import are available for an installed Kokkos
GLOBAL_RESET(KOKKOS_TPL_EXPORTS)
# We need these for controlling the exact -std flag
GLOBAL_RESET(KOKKOS_DONT_ALLOW_EXTENSIONS)
GLOBAL_RESET(KOKKOS_USE_CXX_EXTENSIONS)
GLOBAL_RESET(KOKKOS_CXX_STANDARD_FEATURE)
GLOBAL_SET(KOKKOS_TPL_EXPORTS)

# Include a set of Kokkos-specific wrapper functions that
# will either call raw CMake or TriBITS
Expand Down
4 changes: 0 additions & 4 deletions cmake/fake_tribits.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ IF(NOT ${MACRO_DEFINE_NAME} STREQUAL "")
ENDIF()
ENDMACRO()

MACRO(GLOBAL_RESET VARNAME)
SET(${VARNAME} "" CACHE INTERNAL "" FORCE)
ENDMACRO()

MACRO(GLOBAL_OVERWRITE VARNAME VALUE TYPE)
SET(${VARNAME} ${VALUE} CACHE ${TYPE} "" FORCE)
ENDMACRO()
Expand Down
1 change: 1 addition & 0 deletions cmake/kokkos_enable_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ KOKKOS_ENABLE_OPTION(CUDA_LDG_INTRINSIC OFF "Whether to use CUDA LDG intrinsic
KOKKOS_ENABLE_OPTION(HIP_RELOCATABLE_DEVICE_CODE OFF "Whether to enable relocatable device code (RDC) for HIP")
KOKKOS_ENABLE_OPTION(HPX_ASYNC_DISPATCH OFF "Whether HPX supports asynchronous dispatch")
KOKKOS_ENABLE_OPTION(TESTS OFF "Whether to build the unit tests")
KOKKOS_ENABLE_OPTION(EXAMPLES OFF "Whether to build the examples")
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" UPPERCASE_CMAKE_BUILD_TYPE)
IF(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
KOKKOS_ENABLE_OPTION(DEBUG ON "Whether to activate extra debug features - may increase compile times")
Expand Down
4 changes: 0 additions & 4 deletions cmake/kokkos_install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,5 @@ ELSE()
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/KokkosConfig_install.cmake" "${KOKKOS_TRILINOS_CONFIG}")
ENDIF()

# build and install pkgconfig file
CONFIGURE_FILE(core/src/kokkos.pc.in kokkos.pc @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/kokkos.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/KokkosCore_config.h DESTINATION ${KOKKOS_HEADER_DIR})

14 changes: 14 additions & 0 deletions cmake/kokkos_tribits.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ MACRO(KOKKOS_SUBPACKAGE 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()

Expand Down Expand Up @@ -409,3 +411,15 @@ MACRO(KOKKOS_ADD_TEST_DIRECTORIES)
ENDIF()
ENDIF()
ENDMACRO()

MACRO(KOKKOS_ADD_EXAMPLE_DIRECTORIES)
if (KOKKOS_HAS_TRILINOS)
TRIBITS_ADD_EXAMPLE_DIRECTORIES(${ARGN})
else()
IF(KOKKOS_ENABLE_EXAMPLES)
FOREACH(EXAMPLE_DIR ${ARGN})
ADD_SUBDIRECTORY(${EXAMPLE_DIR})
ENDFOREACH()
ENDIF()
endif()
ENDMACRO()
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Subpackage name must match what appears in kokkos/cmake/Dependencies.cmake
#
#KOKKOS_SUBPACKAGE(Example)
KOKKOS_SUBPACKAGE(Example)

KOKKOS_ADD_EXAMPLE_DIRECTORIES(query_device)
if(NOT Kokkos_ENABLE_CUDA)
Expand Down
27 changes: 27 additions & 0 deletions scripts/testing_scripts/generate_makefile.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

KOKKOS_DEVICES=""

KOKKOS_DO_EXAMPLES="1"

while [[ $# > 0 ]]
do
key="$1"
Expand Down Expand Up @@ -79,6 +81,9 @@ do
echo "Warning: ${key} is deprecated"
echo "Call make with appropriate -j flag"
;;
--no-examples)
KOKKOS_DO_EXAMPLES="0"
;;
--compiler*)
COMPILER="${key#*=}"
CNUM=$(command -v ${COMPILER} 2>&1 >/dev/null | grep "no ${COMPILER}" | wc -l)
Expand Down Expand Up @@ -437,13 +442,28 @@ echo -e "\t\$(MAKE) -C core/perf_test" >> Makefile
echo -e "\t\$(MAKE) -C containers/unit_tests" >> Makefile
echo -e "\t\$(MAKE) -C containers/performance_tests" >> Makefile
echo -e "\t\$(MAKE) -C algorithms/unit_tests" >> Makefile
if [ ${KOKKOS_DO_EXAMPLES} -gt 0 ]; then
$()
echo -e "\t\$(MAKE) -C example/fixture" >> Makefile
echo -e "\t\$(MAKE) -C example/feint" >> Makefile
echo -e "\t\$(MAKE) -C example/fenl" >> Makefile
echo -e "\t\$(MAKE) -C example/make_buildlink build" >> Makefile
echo -e "\t\$(MAKE) -C example/tutorial build" >> Makefile
fi
echo "" >> Makefile
echo "test: build-test" >> Makefile
echo -e "\t\$(MAKE) -C core/unit_test test" >> Makefile
echo -e "\t\$(MAKE) -C core/perf_test test" >> Makefile
echo -e "\t\$(MAKE) -C containers/unit_tests test" >> Makefile
echo -e "\t\$(MAKE) -C containers/performance_tests test" >> Makefile
echo -e "\t\$(MAKE) -C algorithms/unit_tests test" >> Makefile
if [ ${KOKKOS_DO_EXAMPLES} -gt 0 ]; then
echo -e "\t\$(MAKE) -C example/fixture test" >> Makefile
echo -e "\t\$(MAKE) -C example/feint test" >> Makefile
echo -e "\t\$(MAKE) -C example/fenl test" >> Makefile
echo -e "\t\$(MAKE) -C example/make_buildlink test" >> Makefile
echo -e "\t\$(MAKE) -C example/tutorial test" >> Makefile
fi
echo "" >> Makefile
echo "unit-tests-only:" >> Makefile
echo -e "\t\$(MAKE) -C core/unit_test test" >> Makefile
Expand All @@ -457,4 +477,11 @@ echo -e "\t\$(MAKE) -C core/perf_test clean" >> Makefile
echo -e "\t\$(MAKE) -C containers/unit_tests clean" >> Makefile
echo -e "\t\$(MAKE) -C containers/performance_tests clean" >> Makefile
echo -e "\t\$(MAKE) -C algorithms/unit_tests clean" >> Makefile
if [ ${KOKKOS_DO_EXAMPLES} -gt 0 ]; then
echo -e "\t\$(MAKE) -C example/fixture clean" >> Makefile
echo -e "\t\$(MAKE) -C example/feint clean" >> Makefile
echo -e "\t\$(MAKE) -C example/fenl clean" >> Makefile
echo -e "\t\$(MAKE) -C example/make_buildlink clean" >> Makefile
echo -e "\t\$(MAKE) -C example/tutorial clean" >> Makefile
fi

0 comments on commit c1afdf4

Please sign in to comment.