10 #ifndef TPETRA_DETAILS_FILL_UQ_PCE_HPP
11 #define TPETRA_DETAILS_FILL_UQ_PCE_HPP
13 #include "Tpetra_Details_fill.hpp"
20 template<
class DT,
class ... DP,
24 typename std::enable_if<
26 fill (
const ExecutionSpace& execSpace,
27 const Kokkos::View<DT,DP...>& X,
28 const ValueType& alpha,
29 const IndexType numRows,
30 const IndexType numCols)
32 static_assert (std::is_integral<IndexType>::value,
33 "IndexType must be a built-in integer type.");
37 template<
class DT,
class ... DP,
41 typename std::enable_if<
43 fill (
const ExecutionSpace& execSpace,
44 const Kokkos::View<DT,DP...>& X,
45 const ValueType& alpha,
46 const IndexType numRows,
47 const IndexType numCols,
48 const size_t whichVectors[])
50 typedef Kokkos::View<DT,DP...> ViewType;
51 static_assert (ViewType::rank == 2,
"ViewType must be a rank-2 "
52 "Kokkos::View in order to call the \"whichVectors\" "
53 "specialization of fill.");
54 static_assert (std::is_integral<IndexType>::value,
55 "IndexType must be a built-in integer type.");
56 for (IndexType k = 0; k < numCols; ++k) {
57 const IndexType
j = whichVectors[k];
58 auto X_j = Kokkos::subview (X, Kokkos::ALL (), j);
67 #endif // TPETRA_DETAILS_FILL_UQ_PCE_HPP
void deep_copy(const Stokhos::CrsMatrix< ValueType, DstDevice, Layout > &dst, const Stokhos::CrsMatrix< ValueType, SrcDevice, Layout > &src)
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)