68 Teuchos::ETransp mode,
72 using impl_scalar_type =
typename Kokkos::ArithTraits<Scalar>::val_type;
73 impl_scalar_type implAlpha = alpha;
79 typename Aggregates::aggregates_sizes_type::const_type aggSizes = aggregates_->ComputeAggregateSizes();
81 auto kokkos_view_X = X.getDeviceLocalView(Xpetra::Access::ReadOnly);
82 auto kokkos_view_Y = Y.getDeviceLocalView(Xpetra::Access::ReadWrite);
83 LO numCols = kokkos_view_X.extent(1);
85 if(mode == Teuchos::TRANS) {
86 auto vertex2AggId = aggregates_->GetVertex2AggId();
87 auto vertex2AggIdView = vertex2AggId->getDeviceLocalView(Xpetra::Access::ReadOnly);
88 LO numNodes = kokkos_view_X.extent(0);
92 Kokkos::parallel_for(
"MueLu:MatrixFreeTentativeR_kokkos:apply",
md_range_type({0,0},{numCols,numNodes}),
93 KOKKOS_LAMBDA(
const int colIdx,
const int NodeIdx) {
94 LO aggIdx = vertex2AggIdView(NodeIdx,0);
96 Kokkos::atomic_add(&kokkos_view_Y(aggIdx,colIdx),implAlpha*kokkos_view_X(NodeIdx,colIdx)/Kokkos::sqrt(aggSizes(aggIdx)));
100 const auto vertex2Agg = aggregates_->GetVertex2AggId();
101 auto vertex2AggView = vertex2Agg->getDeviceLocalView(Xpetra::Access::ReadOnly);
102 LO numNodes = kokkos_view_Y.extent(0);
106 Kokkos::parallel_for(
"MueLu:MatrixFreeTentativeP:apply",
md_range_type({0,0},{numCols,numNodes}),
107 KOKKOS_LAMBDA(
const int colIdx,
const int fineIdx) {
108 LO aggIdx = vertex2AggView(fineIdx,0);
109 kokkos_view_Y(fineIdx,colIdx) += implAlpha*kokkos_view_X(aggIdx,colIdx)/Kokkos::sqrt(aggSizes(aggIdx));