From 7d80484c2d42bb410ff218b25e5a3ffaf1fb7a5d Mon Sep 17 00:00:00 2001 From: Roger Pawlowski Date: Thu, 9 May 2024 11:06:20 -0600 Subject: [PATCH] Panzer: fix cuda 12 compiler issue --- .../evaluators/Panzer_CellExtreme_impl.hpp | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/packages/panzer/disc-fe/src/evaluators/Panzer_CellExtreme_impl.hpp b/packages/panzer/disc-fe/src/evaluators/Panzer_CellExtreme_impl.hpp index 701f8b7fdcb2..1da112b23943 100644 --- a/packages/panzer/disc-fe/src/evaluators/Panzer_CellExtreme_impl.hpp +++ b/packages/panzer/disc-fe/src/evaluators/Panzer_CellExtreme_impl.hpp @@ -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); - } - }); + // take first point + if (qp == 0) + extreme_view(cell) = current; + else // use_min + extreme_view(cell) = extreme_view(cell)>current ? current : extreme_view(cell); + } + }); + } } //**********************************************************************