Skip to content

Commit

Permalink
Adding BLAS routines back, for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
eeprude committed Oct 25, 2023
1 parent 7c9ed9e commit 6ac5ba3
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
55 changes: 55 additions & 0 deletions blas/src/KokkosBlas_gesv.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//@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

/// \file KokkosBlas_gesv.hpp
/// \brief Local dense linear solve
///
/// This file provides KokkosBlas::gesv. This function performs a
/// local (no MPI) dense linear solve on a system of linear equations
/// A * X = B where A is a general N-by-N matrix and X and B are N-by-NRHS
/// matrices.

#ifndef KOKKOSBLAS_GESV_HPP_
#define KOKKOSBLAS_GESV_HPP_

#include "KokkosLapack_gesv.hpp"

namespace KokkosBlas {

/// \brief Solve the dense linear equation system A*X = B.
///
/// \tparam AMatrix Input matrix/Output LU, as a 2-D Kokkos::View.
/// \tparam BXMV Input (right-hand side)/Output (solution) (multi)vector, as a
/// 1-D or 2-D Kokkos::View. \tparam IPIVV Output pivot indices, as a 1-D
/// Kokkos::View
///
/// \param A [in,out] On entry, the N-by-N matrix to be solved. On exit, the
/// factors L and U from
/// the factorization A = P*L*U; the unit diagonal elements of L are not
/// stored.
/// \param B [in,out] On entry, the right hand side (multi)vector B. On exit,
/// the solution (multi)vector X. \param IPIV [out] On exit, the pivot indices
/// (for partial pivoting). If the View extents are zero and
/// its data pointer is NULL, pivoting is not used.
///
template <class AMatrix, class BXMV, class IPIVV>
[[deprecated]] void gesv(const AMatrix& A, const BXMV& B, const IPIVV& IPIV) {
KokkosLapack::gesv(A,B,IPIV);
}

} // namespace KokkosBlas

#endif // KOKKOSBLAS_GESV_HPP_
52 changes: 52 additions & 0 deletions blas/src/KokkosBlas_trtri.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//@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 KOKKOSBLAS_TRTRI_HPP_
#define KOKKOSBLAS_TRTRI_HPP_

/// \file KokkosBlas_trtri.hpp

#include "KokkosLapack_trtri.hpp"

namespace KokkosBlas {

/// \brief Find the inverse of the triangular matrix, A
///
/// A = inv(A)
///
/// \tparam AViewType Input matrix, as a 2-D Kokkos::View
///
/// \param uplo [in] "U" or "u" indicates matrix A is an upper triangular
/// matrix
/// "L" or "l" indicates matrix A is a lower triangular matrix
/// \param diag [in] "U" or "u" indicates the diagonal of A is assumed to be
/// unit
// "N" or "n" indicates the diagonal of A is assumed to be
// non-unit
/// \param A [in,out] Input matrix, as a 2-D Kokkos::View
/// On entry, A
/// On successful exit, inv(A)
/// \return 0 upon success,
// i if the i-th diagonal elemet of A is zero, A is singular,
// and the inversion could not be completed.
// source: https://software.intel.com/en-us/mkl-developer-reference-c-trtri
template <class AViewType>
[[deprecated]] int trtri(const char uplo[], const char diag[], const AViewType& A) {
return KokkosLapack::trtri(uplo, diag, A);
}

} // namespace KokkosBlas

#endif // KOKKOS_BLASLAPACK_TRTRI_HPP_

0 comments on commit 6ac5ba3

Please sign in to comment.