42#ifndef TPETRA_DETAILS_FILL_MP_VECTOR_HPP
43#define TPETRA_DETAILS_FILL_MP_VECTOR_HPP
45#include "Tpetra_Details_fill.hpp"
52template<
class DT,
class ... DP,
56typename std::enable_if<
58fill (
const ExecutionSpace& execSpace,
59 const Kokkos::View<DT,DP...>& X,
60 const ValueType& alpha,
61 const IndexType numRows,
62 const IndexType numCols)
64 static_assert (std::is_integral<IndexType>::value,
65 "IndexType must be a built-in integer type.");
66 Kokkos::deep_copy(execSpace, X, alpha);
69template<
class DT,
class ... DP,
73typename std::enable_if<
75fill (
const ExecutionSpace& execSpace,
76 const Kokkos::View<DT,DP...>& X,
77 const ValueType& alpha,
78 const IndexType numRows,
79 const IndexType numCols,
80 const size_t whichVectors[])
82 typedef Kokkos::View<DT,DP...> ViewType;
83 static_assert (ViewType::Rank == 2,
"ViewType must be a rank-2 "
84 "Kokkos::View in order to call the \"whichVectors\" "
85 "specialization of fill.");
86 static_assert (std::is_integral<IndexType>::value,
87 "IndexType must be a built-in integer type.");
88 for (IndexType k = 0; k < numCols; ++k) {
89 const IndexType
j = whichVectors[k];
90 auto X_j = Kokkos::subview (X, Kokkos::ALL (),
j);
91 Kokkos::deep_copy(execSpace, X_j, alpha);
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< DT, DP... > >::value >::type fill(const ExecutionSpace &execSpace, const Kokkos::View< DT, DP... > &X, const ValueType &alpha, const IndexType numRows, const IndexType numCols)