From b60e9913fb3276bf3f46bc3a5ecd45c93d720419 Mon Sep 17 00:00:00 2001 From: meriadeg perrinel Date: Mon, 6 Feb 2023 15:13:47 +0100 Subject: [PATCH] #5: moved print_configuration to header only file and added its test --- common/CMakeLists.txt | 2 - .../src/kokkoskernels_print_configuration.cpp | 81 ------------------- .../src/kokkoskernels_print_configuration.hpp | 28 ------- common/unit_test/Test_Common.hpp | 1 + perf_test/Benchmark_Context.hpp | 2 +- 5 files changed, 2 insertions(+), 112 deletions(-) delete mode 100644 common/src/kokkoskernels_print_configuration.cpp delete mode 100644 common/src/kokkoskernels_print_configuration.hpp diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 3acc28a7ba..72972b5cd7 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -7,5 +7,3 @@ LIST(APPEND KK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/common/unit_test) # Adding unit-tests KOKKOSKERNELS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/common) KOKKOSKERNELS_INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR}/common) - -LIST(APPEND SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/common/src/kokkoskernels_print_configuration.cpp) diff --git a/common/src/kokkoskernels_print_configuration.cpp b/common/src/kokkoskernels_print_configuration.cpp deleted file mode 100644 index 5d2d0523c8..0000000000 --- a/common/src/kokkoskernels_print_configuration.cpp +++ /dev/null @@ -1,81 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 4.0 -// Copyright (2022) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. -// See https://kokkos.org/LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//@HEADER - -#include "kokkoskernels_print_configuration.hpp" -#include "KokkosKernels_config.h" - -#include - -namespace { -void print_enabled_tpls(std::ostream& os) { -#ifdef KOKKOSKERNELS_ENABLE_TPL_LAPACK - os << "LAPACK" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_BLAS - os << "BLAS" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_CBLAS - os << "CBLAS" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_LAPACKE - os << "LAPACKE" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_SUPERLU - os << "SUPERLU" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_CHOLMOD - os << "CHOLMOD" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_MKL - os << "MKL" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_CUBLAS - os << "CUBLAS" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_CUSPARSE - os << "CUSPARSE" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_ROCBLAS - os << "ROCBLAS" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_ROCPARSE - os << "ROCPARSE" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_METIS - os << "METIS" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_ARMPL - tpls << "ARMPL" << ";"; -#endif -#ifdef KOKKOSKERNELS_ENABLE_TPL_MAGMA - tpls << "MAGMA" << ";"; -#endif -} - -void print_version(std::ostream& os) { - os << "Kernels Version: "<< KOKKOSKERNELS_VERSION <<'\n'; -} - -} // namespace - -void KokkosKernels::print_configuration(std::ostream& os) { - print_version(os); - - os << "Enabled TPLs names:\n"; - print_enabled_tpls(os); - -} - diff --git a/common/src/kokkoskernels_print_configuration.hpp b/common/src/kokkoskernels_print_configuration.hpp deleted file mode 100644 index f98fb9278d..0000000000 --- a/common/src/kokkoskernels_print_configuration.hpp +++ /dev/null @@ -1,28 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 4.0 -// Copyright (2022) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. -// See https://kokkos.org/LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//@HEADER - -#ifndef _KOKKOSKERNELS_PRINT_CONFIGURATION_HPP -#define _KOKKOSKERNELS_PRINT_CONFIGURATION_HPP - -#include - -namespace KokkosKernels { - -/** \brief Print "Bill of Materials" */ -void print_configuration(std::ostream& os); - -} // namespace KokkosKernels -#endif // _KOKKOSKERNELS_PRINT_CONFIGURATION_HPP diff --git a/common/unit_test/Test_Common.hpp b/common/unit_test/Test_Common.hpp index dd368f009b..36bc4bcf35 100644 --- a/common/unit_test/Test_Common.hpp +++ b/common/unit_test/Test_Common.hpp @@ -23,5 +23,6 @@ #include #include #include +#include #endif // TEST_COMMON_HPP diff --git a/perf_test/Benchmark_Context.hpp b/perf_test/Benchmark_Context.hpp index 073de9e161..f9ce7bb744 100644 --- a/perf_test/Benchmark_Context.hpp +++ b/perf_test/Benchmark_Context.hpp @@ -42,7 +42,7 @@ std::string remove_unwanted_characters(std::string str) { return str.substr(from, to + 1); } -/// \brief Extract all key:value pairs from kokkos configuration and add it to +/// \brief Extract all key:value pairs from kernels configuration and add it to /// the benchmark context void add_kernels_configuration(bool verbose) { std::ostringstream msg;