-
Notifications
You must be signed in to change notification settings - Fork 99
BLAS 2::syr
Luc Berger edited this page Apr 23, 2024
·
1 revision
Header File: KokkosBlas2_syr.hpp
Usage: KokkosBlas::syr (space, mode, uplo, alpha, x, A);
Matrix symmetric Rank 1 update: A = A + alpha * x * x^{T,H}
template <class ExecutionSpace,
class XViewType,
class AViewType>
void ger(const ExecutionSpace& space,
const char trans[],
const char uplo[],
const typename AViewType::const_value_type& alpha,
const XViewType& x,
const AViewType& A)
template <class XViewType,
class AViewType>
void ger(const char trans[],
const char uplo[],
const typename AViewType::const_value_type& alpha,
const XViewType& x,
const AViewType& A)
- ExecutionSpace: A Kokkos execution space
- XViewType: A rank-1
Kokkos::View
- AViewType: A rank-2
Kokkos::View
- trans [in] "T" for transpose, "H" for conjugate transpose. All characters after the first are ignored. This works just like the BLAS routines.
- uplo [in] "U" or "u" for upper portion, "L" or "l" for lower portion. Only the first character is taken into account.
- alpha [in] Input coefficient of x*y
- x [in] Input vector, as a 1-D Kokkos::View
- A [in/out] Output matrix, as a nonconst 2-D Kokkos::View
-
x
is a rank-1 views -
A
is a rank-2 view -
x
andA
have memory space accessible fromExecutionSpace
A.extent(0) == x.extent(0) && A.extent(1) == A.extent(0)
#include <Kokkos_Core.hpp>
#include <KokkosBlas2_syr.hpp>
int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int M = 5;
Kokkos::View<double**> A("A", M, M);
Kokkos::View<double*> x("X", M);
Kokkos::deep_copy(A, 1.0);
Kokkos::deep_copy(x, 3.0);
const double alpha = double(1.0);
KokkosBlas::syr("T", "U", alpha, x, A);
}
Kokkos::finalize();
}