Skip to content

Commit 9d039ff

Browse files
committed
Replace max by Kokkos::max inside kernels
1 parent 1939c58 commit 9d039ff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/pmpo_MPMesh_assembly.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -453,13 +453,13 @@ void MPMesh::invertMatrix(const Kokkos::View<double**>& vtxMatrices, const doubl
453453
auto diffTr = subM1(0, 0)-subM1(1, 1);
454454
auto delG = sqrt(4.0 * pow(subM1(0, 1), 2) + pow(diffTr, 2));
455455
if(delG<small){
456-
subM1(0, 0) = max(subM1(0, 0), truncate);
457-
subM1(1, 1) = max(subM1(1, 1), truncate);
456+
subM1(0, 0) = Kokkos::max(subM1(0, 0), truncate);
457+
subM1(1, 1) = Kokkos::max(subM1(1, 1), truncate);
458458
subM1(0, 1) = 0.0;
459459
}
460460
else{
461-
auto minEig = max(0.5 * (trG - delG), truncate);
462-
auto maxEig = max(0.5 * (trG + delG), truncate);
461+
auto minEig = Kokkos::max(0.5 * (trG - delG), truncate);
462+
auto maxEig = Kokkos::max(0.5 * (trG + delG), truncate);
463463
auto trG = minEig + maxEig;
464464
auto diffEig = maxEig - minEig;
465465
diffTr = diffTr / delG;
@@ -470,7 +470,7 @@ void MPMesh::invertMatrix(const Kokkos::View<double**>& vtxMatrices, const doubl
470470

471471
double denom = subM1(0, 0) * subM1(1, 1) - pow(subM1(0, 1), 2) ;
472472
double minZ2 = (subM1(1, 1) * pow(subM1(0, 2), 2) + subM1(0, 0) * pow(subM1(1, 2), 2) - 2.0 * subM1(0, 1) * subM1(0, 2) * subM1(1, 2))/denom;
473-
subM1(2, 2) = max(subM1(2, 2), abs(minZ2) + truncate);
473+
subM1(2, 2) = Kokkos::max(subM1(2, 2), abs(minZ2) + truncate);
474474

475475
double invM2D[6]={0.0};
476476
invM2D[0] = subM1(2, 2) * subM1(1, 1) - subM1(1, 2) * subM1(1, 2);

0 commit comments

Comments
 (0)