Skip to content

Commit

Permalink
Merge Pull Request #13000 from rppawlo/Trilinos/panzer-fix-cell-extreme
Browse files Browse the repository at this point in the history
Automatically Merged using Trilinos Pull Request AutoTester
PR Title: b'Panzer: fix cuda 12 compiler issue'
PR Author: rppawlo
  • Loading branch information
trilinos-autotester authored May 10, 2024
2 parents 53b714a + 7d80484 commit 54cae66
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions packages/panzer/disc-fe/src/evaluators/Panzer_CellExtreme_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,31 @@ evaluateFields(
}

// take extreme over points in each cell
Kokkos::parallel_for ("CellExtreme", workset.num_cells, KOKKOS_LAMBDA( const int cell) {
for (std::size_t qp = 0; qp < num_pt; ++qp) {
auto current = mult_field(cell, qp);
if (extreme_max) {
Kokkos::parallel_for ("CellExtreme (max)", workset.num_cells, KOKKOS_LAMBDA( const int cell) {
for (std::size_t qp = 0; qp < num_pt; ++qp) {
auto current = mult_field(cell, qp);

// take first point
if (qp == 0)
extreme_view(cell) = current;
else
extreme_view(cell) = extreme_view(cell)<current ? current : extreme_view(cell);
}
});
} else {
Kokkos::parallel_for ("CellExtreme (min)", workset.num_cells, KOKKOS_LAMBDA( const int cell) {
for (std::size_t qp = 0; qp < num_pt; ++qp) {
auto current = mult_field(cell, qp);

// take first point
if (qp == 0)
extreme_view(cell) = current;

// take largest value in the cell
if(extreme_max)
extreme_view(cell) = extreme_view(cell)<current ? current : extreme_view(cell);
else // use_min
extreme_view(cell) = extreme_view(cell)>current ? current : extreme_view(cell);
}
});
// take first point
if (qp == 0)
extreme_view(cell) = current;
else // use_min
extreme_view(cell) = extreme_view(cell)>current ? current : extreme_view(cell);
}
});
}
}

//**********************************************************************
Expand Down

0 comments on commit 54cae66

Please sign in to comment.