10 #ifndef TPETRA_DETAILS_FILL_HPP
11 #define TPETRA_DETAILS_FILL_HPP
23 #include <type_traits>
36 template <
class ViewType,
40 void fill(
const ExecutionSpace& execSpace,
42 const ValueType& alpha,
43 const IndexType numRows,
44 const IndexType numCols) {
45 static_assert(std::is_integral<IndexType>::value,
46 "IndexType must be a built-in integer type.");
47 auto X_j = Kokkos::subview(X, Kokkos::make_pair(IndexType(0), numRows), Kokkos::make_pair(IndexType(0), numCols));
51 template <
class ViewType,
55 void fill(
const ExecutionSpace& execSpace,
57 const ValueType& alpha,
58 const IndexType numRows,
59 const IndexType numCols,
60 const size_t whichVectors[]) {
61 static_assert(ViewType::rank == 2,
62 "ViewType must be a rank-2 "
63 "Kokkos::View in order to call the \"whichVectors\" "
64 "specialization of fill.");
65 static_assert(std::is_integral<IndexType>::value,
66 "IndexType must be a built-in integer type.");
67 for (IndexType k = 0; k < numCols; ++k) {
68 const IndexType j = whichVectors[k];
69 auto X_j = Kokkos::subview(X, Kokkos::make_pair(IndexType(0), numRows), j);
78 #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.