Skip to content

Commit

Permalink
Set version support for Kokkos Kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau committed Dec 24, 2024
1 parent 651307f commit 79e2d84
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 66 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ if("${DDC_BUILD_KERNELS_SPLINES}")
)
if("${DDC_KokkosKernels_DEPENDENCY_POLICY}" STREQUAL "AUTO")
if(NOT TARGET Kokkos::kokkoskernels)
find_package(KokkosKernels QUIET)
find_package(KokkosKernels 4.5...<5 QUIET)
if(NOT KokkosKernels_FOUND)
ddc_configure_kokkos_kernels()
endif()
endif()
elseif("${DDC_KokkosKernels_DEPENDENCY_POLICY}" STREQUAL "EMBEDDED")
ddc_configure_kokkos_kernels()
elseif("${DDC_KokkosKernels_DEPENDENCY_POLICY}" STREQUAL "INSTALLED")
find_package(KokkosKernels REQUIRED)
find_package(KokkosKernels 4.5...<5 REQUIRED)
endif()

add_library(ddc_splines INTERFACE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/DDCConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if(@DDC_BUILD_KERNELS_SPLINES@)
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
ddc_find_dependency(LAPACKE)
list(POP_FRONT CMAKE_MODULE_PATH)
ddc_find_dependency(KokkosKernels)
ddc_find_dependency(KokkosKernels 4.5...<5)
endif()

if(@DDC_BUILD_PDI_WRAPPER@)
Expand Down
2 changes: 1 addition & 1 deletion docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set(DOXYGEN_EXAMPLE_PATH "${DDC_SOURCE_DIR}/examples")
set(DOXYGEN_EXPAND_ONLY_PREDEF YES)
set(DOXYGEN_EXTRACT_ALL YES CACHE STRING "")
set(DOXYGEN_EXCLUDE_SYMBOLS "detail")
set(DOXYGEN_EXCLUDE_PATTERNS "*/experimental/*;*/detail/*")
set(DOXYGEN_EXCLUDE_PATTERNS "*/detail/*;*/experimental/*;*/kokkos-kernels-ext/*")
set(DOXYGEN_EXTRACT_LOCAL_CLASSES YES)
set(DOXYGEN_FULL_PATH_NAMES NO)
set(DOXYGEN_HTML_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
//@HEADER
// ************************************************************************
// Copyright (C) The DDC development team, see COPYRIGHT.md file
//
// 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
// SPDX-License-Identifier: MIT

// clang-format off
// NOLINTBEGIN(*)

#ifndef KOKKOSBATCHED_GBTRS_HPP_
#define KOKKOSBATCHED_GBTRS_HPP_

Expand Down Expand Up @@ -62,3 +54,6 @@ struct SerialGbtrs {
#include "KokkosBatched_Gbtrs_Serial_Impl.hpp"

#endif // KOKKOSBATCHED_GBTRS_HPP_

// NOLINTEND(*)
// clang-format on
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
//@HEADER
// ************************************************************************
// Copyright (C) The DDC development team, see COPYRIGHT.md file
//
// 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
// SPDX-License-Identifier: MIT

// clang-format off
// NOLINTBEGIN(*)

#ifndef KOKKOSBATCHED_GBTRS_SERIAL_IMPL_HPP_
#define KOKKOSBATCHED_GBTRS_SERIAL_IMPL_HPP_
Expand Down Expand Up @@ -174,3 +165,6 @@ struct SerialGbtrs<Trans::Transpose, Algo::Level3::Unblocked> {
} // namespace KokkosBatched

#endif // KOKKOSBATCHED_GBTRS_SERIAL_IMPL_HPP_

// NOLINTEND(*)
// clang-format on
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
//@HEADER
// ************************************************************************
// Copyright (C) The DDC development team, see COPYRIGHT.md file
//
// 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
// SPDX-License-Identifier: MIT

// clang-format off
// NOLINTBEGIN(*)

#ifndef KOKKOSBATCHED_GETRS_HPP_
#define KOKKOSBATCHED_GETRS_HPP_

Expand Down Expand Up @@ -51,3 +43,6 @@ struct SerialGetrs {
#include "KokkosBatched_Getrs_Serial_Impl.hpp"

#endif // KOKKOSBATCHED_GETRS_HPP_

// NOLINTEND(*)
// clang-format on
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
//@HEADER
// ************************************************************************
// Copyright (C) The DDC development team, see COPYRIGHT.md file
//
// 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
// SPDX-License-Identifier: MIT

// clang-format off
// NOLINTBEGIN(*)

#ifndef KOKKOSBATCHED_GETRS_SERIAL_IMPL_HPP_
#define KOKKOSBATCHED_GETRS_SERIAL_IMPL_HPP_
Expand Down Expand Up @@ -69,8 +60,8 @@ struct SerialGetrs<Trans::NoTranspose, Algo::Level3::Unblocked> {

[[maybe_unused]] auto info_laswp = KokkosBatched::SerialLaswp<Direct::Forward>::invoke(piv, b);

auto info_trsm = KokkosBatched::SerialTrsm<Side::Left, Uplo::Lower, Trans::NoTranspose, Diag::Unit,
Algo::Trsm::Unblocked>::invoke(1.0, A, b);
[[maybe_unused]] auto info_trsm = KokkosBatched::SerialTrsm<Side::Left, Uplo::Lower, Trans::NoTranspose, Diag::Unit,
Algo::Trsm::Unblocked>::invoke(1.0, A, b);
info_trsm = KokkosBatched::SerialTrsm<Side::Left, Uplo::Upper, Trans::NoTranspose, Diag::NonUnit,
Algo::Trsm::Unblocked>::invoke(1.0, A, b);

Expand All @@ -89,8 +80,8 @@ struct SerialGetrs<Trans::Transpose, Algo::Level3::Unblocked> {
auto info = checkGetrsInput(A, b);
if (info) return info;

auto info_trsm = KokkosBatched::SerialTrsm<Side::Left, Uplo::Upper, Trans::Transpose, Diag::NonUnit,
Algo::Trsm::Unblocked>::invoke(1.0, A, b);
[[maybe_unused]] auto info_trsm = KokkosBatched::SerialTrsm<Side::Left, Uplo::Upper, Trans::Transpose, Diag::NonUnit,
Algo::Trsm::Unblocked>::invoke(1.0, A, b);
info_trsm =
KokkosBatched::SerialTrsm<Side::Left, Uplo::Lower, Trans::Transpose, Diag::Unit, Algo::Trsm::Unblocked>::invoke(
1.0, A, b);
Expand All @@ -103,3 +94,6 @@ struct SerialGetrs<Trans::Transpose, Algo::Level3::Unblocked> {
} // namespace KokkosBatched

#endif // KOKKOSBATCHED_GETRS_SERIAL_IMPL_HPP_

// NOLINTEND(*)
// clang-format on
3 changes: 2 additions & 1 deletion include/ddc/kernels/splines/splines_linear_problem_band.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#include <lapacke.h>
#endif

#include "KokkosBatched_Gbtrs.hpp"
#include <KokkosBatched_Util.hpp>

#include "kokkos-kernels-ext/KokkosBatched_Gbtrs.hpp"

#include "splines_linear_problem.hpp"

namespace ddc::detail {
Expand Down
3 changes: 2 additions & 1 deletion include/ddc/kernels/splines/splines_linear_problem_dense.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
#include <lapacke.h>
#endif

#include "KokkosBatched_Getrs.hpp"
#include <KokkosBatched_Util.hpp>

#include "kokkos-kernels-ext/KokkosBatched_Getrs.hpp"

#include "splines_linear_problem.hpp"

namespace ddc::detail {
Expand Down

0 comments on commit 79e2d84

Please sign in to comment.