42 #ifndef TPETRA_DETAILS_FILL_HPP
43 #define TPETRA_DETAILS_FILL_HPP
55 #include <type_traits>
68 template<
class ViewType,
73 fill (
const ExecutionSpace& execSpace,
75 const ValueType& alpha,
76 const IndexType numRows,
77 const IndexType numCols)
79 static_assert (std::is_integral<IndexType>::value,
80 "IndexType must be a built-in integer type.");
81 auto X_j = Kokkos::subview (X, Kokkos::make_pair(IndexType(0), numRows), Kokkos::make_pair(IndexType(0), numCols));
85 template<
class ViewType,
90 fill (
const ExecutionSpace& execSpace,
92 const ValueType& alpha,
93 const IndexType numRows,
94 const IndexType numCols,
95 const size_t whichVectors[])
97 static_assert (ViewType::rank == 2,
"ViewType must be a rank-2 "
98 "Kokkos::View in order to call the \"whichVectors\" "
99 "specialization of fill.");
100 static_assert (std::is_integral<IndexType>::value,
101 "IndexType must be a built-in integer type.");
102 for (IndexType k = 0; k < numCols; ++k) {
103 const IndexType j = whichVectors[k];
104 auto X_j = Kokkos::subview (X, Kokkos::make_pair(IndexType(0), numRows), j);
113 #endif // TPETRA_DETAILS_FILL_HPP
Type traits for Tpetra's BLAS wrappers; an implementation detail of Tpetra::MultiVector.
void deep_copy(MultiVector< DS, DL, DG, DN > &dst, const MultiVector< SS, SL, SG, SN > &src)
Copy the contents of the MultiVector src into dst.