Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tpetra: Because GCC 5.3.0 hates valid C++ #6205

Merged
merged 1 commit into from
Oct 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/tpetra/core/src/Tpetra_Details_residual.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,12 @@ void localResidual(const CrsMatrix<SC,LO,GO,NO> & A,
int team_size = -1;
int vector_length = -1;
int64_t rows_per_thread = -1;

int64_t numLocalRows = A_lcl.numRows ();
int64_t myNnz = A_lcl.nnz();

const int64_t rows_per_team =
residual_launch_parameters<execution_space>(A_lcl.numRows (), A_lcl.nnz (), rows_per_thread, team_size, vector_length);
int64_t rows_per_team =
residual_launch_parameters<execution_space>(numLocalRows, myNnz, rows_per_thread, team_size, vector_length);
int64_t worksets = (B_lcl.extent (0) + rows_per_team - 1) / rows_per_team;

using policy_type = typename Kokkos::TeamPolicy<execution_space>;
Expand All @@ -236,8 +239,6 @@ void localResidual(const CrsMatrix<SC,LO,GO,NO> & A,
// Vector case
// Kernel interior shamelessly horked from Ifpack2_Details_ScaledDampedResidual_def.hpp
Kokkos::parallel_for("residual-vector",policy,KOKKOS_LAMBDA(const team_member& dev) {
// NOTE: It looks like I should be able to get this data up above, but if I try to
// we get internal compiler errors. Who knew that gcc tried to "gimplify"?
Kokkos::parallel_for(Kokkos::TeamThreadRange (dev, 0, rows_per_team),[&] (const LO& loop) {
const LO lclRow = static_cast<LO> (dev.league_rank ()) * rows_per_team + loop;

Expand Down