Skip to content

Commit

Permalink
Merge pull request #5308 from vbrunini/fix_muelu_nvidia_complex_eti
Browse files Browse the repository at this point in the history
MueLu: Fix #5151.
  • Loading branch information
mhoemmen authored Jun 5, 2019
2 parents c9c61f9 + 0875230 commit f60861f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ namespace MueLu {

auto aggregate = aggGraph.rowConst(i);

typename Teuchos::ScalarTraits<Scalar>::coordinateType sum = 0.0; // do not use Scalar here (Stokhos)
coordinate_type sum = 0.0; // do not use Scalar here (Stokhos)
for (size_t colID = 0; colID < static_cast<size_t>(aggregate.length); colID++)
sum += fineCoordsRandomView(aggregate(colID),j);

Expand Down Expand Up @@ -566,6 +566,7 @@ namespace MueLu {
const size_t NSDim = fineNullspace->getNumVectors();

typedef Kokkos::ArithTraits<SC> ATS;
using impl_ATS = Kokkos::ArithTraits<typename ATS::val_type>;
const SC zero = ATS::zero(), one = ATS::one();

const LO INVALID = Teuchos::OrdinalTraits<LO>::invalid();
Expand Down Expand Up @@ -760,13 +761,13 @@ namespace MueLu {
// Extract the piece of the nullspace corresponding to the aggregate, and
// put it in the flat array, "localQR" (in column major format) for the
// QR routine. Trivial in 1D.
auto norm = ATS::magnitude(zero);
auto norm = impl_ATS::magnitude(zero);

// Calculate QR by hand
// FIXME: shouldn't there be stridedblock here?
// FIXME_KOKKOS: shouldn't there be stridedblock here?
for (decltype(aggSize) k = 0; k < aggSize; k++) {
auto dnorm = ATS::magnitude(fineNSRandom(agg2RowMapLO(aggRows(agg)+k),0));
auto dnorm = impl_ATS::magnitude(fineNSRandom(agg2RowMapLO(aggRows(agg)+k),0));
norm += dnorm*dnorm;
}
norm = sqrt(norm);
Expand Down Expand Up @@ -857,7 +858,7 @@ namespace MueLu {
Kokkos::parallel_for("MueLu:TentativePF:BuildUncoupled:for2", range_type(0, nnzEstimate),
KOKKOS_LAMBDA(const LO j) {
colsAux(j) = INVALID;
valsAux(j) = zero;
valsAux(j) = impl_ATS::zero();
});
}

Expand Down
5 changes: 3 additions & 2 deletions packages/muelu/src/Utils/MueLu_Utilities_kokkos_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ namespace MueLu {
DetectDirichletCols(const Xpetra::Matrix<SC,LO,GO,NO>& A,
const Kokkos::View<const bool*, typename NO::device_type>& dirichletRows) {
using ATS = Kokkos::ArithTraits<SC>;
using impl_ATS = Kokkos::ArithTraits<typename ATS::val_type>;
using range_type = Kokkos::RangePolicy<LO, typename NO::execution_space>;

SC zero = ATS::zero();
Expand Down Expand Up @@ -453,8 +454,8 @@ namespace MueLu {
const typename ATS::magnitudeType eps = 2.0*ATS::eps();

Kokkos::parallel_for("MueLu:Utils::DetectDirichletCols2", range_type(0,numColEntries),
KOKKOS_LAMBDA(const size_t i) {
dirichletCols(i) = ATS::magnitude(myCols(i,0))>eps;
KOKKOS_LAMBDA (const size_t i) {
dirichletCols(i) = impl_ATS::magnitude(myCols(i,0))>eps;
});
return dirichletCols;
}
Expand Down

0 comments on commit f60861f

Please sign in to comment.