10#ifndef TPETRA_DETAILS_FILL_HPP
11#define TPETRA_DETAILS_FILL_HPP
36template<
class ViewType,
41fill (
const ExecutionSpace& execSpace,
43 const ValueType& alpha,
44 const IndexType numRows,
45 const IndexType numCols)
47 static_assert (std::is_integral<IndexType>::value,
48 "IndexType must be a built-in integer type.");
49 auto X_j = Kokkos::subview (X, Kokkos::make_pair(IndexType(0), numRows), Kokkos::make_pair(IndexType(0), numCols));
50 Kokkos::deep_copy(execSpace, X_j, alpha);
53template<
class ViewType,
58fill (
const ExecutionSpace& execSpace,
60 const ValueType& alpha,
61 const IndexType numRows,
62 const IndexType numCols,
63 const size_t whichVectors[])
65 static_assert (ViewType::rank == 2,
"ViewType must be a rank-2 "
66 "Kokkos::View in order to call the \"whichVectors\" "
67 "specialization of fill.");
68 static_assert (std::is_integral<IndexType>::value,
69 "IndexType must be a built-in integer type.");
70 for (IndexType k = 0; k < numCols; ++k) {
71 const IndexType j = whichVectors[k];
72 auto X_j = Kokkos::subview (X, Kokkos::make_pair(IndexType(0), numRows), j);
73 Kokkos::deep_copy(execSpace, X_j, alpha);
Type traits for Tpetra's BLAS wrappers; an implementation detail of Tpetra::MultiVector.
void fill(const ExecutionSpace &execSpace, const ViewType &X, const ValueType &alpha, const IndexType numRows, const IndexType numCols)
Fill the entries of the given 1-D or 2-D Kokkos::View with the given scalar value alpha.
Nonmember function that computes a residual Computes R = B - A * X.
Namespace Tpetra contains the class and methods constituting the Tpetra library.