-
Notifications
You must be signed in to change notification settings - Fork 97
BLAS::trtri
Evan Harvey edited this page Apr 20, 2020
·
1 revision
Header File: KokkosBlas_trtri.hpp
Usage: KokkosBlas::trtri(uplo, diag, A);
Triangular matrix inverse:
A = inv(A)
template<class AViewType,
class BViewType>
void
trtr (const char uplo[],
const char diag[],
const AViewType& A)
- AViewType: 2-D
Kokkos::View
- uplo [in] "U" or "u" indicates matrix A is an upper triangular matrix, "L" or "l" indicates matrix A is a lower triangular matrix.
- diag [in] "U" or "u" indicates the diagonal of A is assumed to be unit, "N" or "n" indicated the diagonal of A is assumed to be non-unit.
- A [in/out] Input matrix, as a 2-D Kokkos::View.
- A must be a square matrix for the triangular matrix inverse.
#include<Kokkos_Core.hpp>
#include<Kokkos_Random.hpp>
#include<KokkosBlas_trtri.hpp>
int main(int argc, char* argv[]) {
Kokkos::initialize();
int M = atoi(argv[1]);
using ViewType = Kokkos::View<double**>;
using Scalar = typename ViewType::value_type;
ViewType A("A",M,M);
Kokkos::Random_XorShift64_Pool<typename ViewType::device_type::execution_space> rand_pool(13718);
Kokkos::fill_random(A,rand_pool,Scalar(10));
const Scalar alpha = 1.0;
KokkosBlas::trtri("L","N",A);
Kokkos::finalize();
}