Skip to content

Commit 6060160

Browse files
committed
Try to fix compilation error with Intel 2024.
1 parent 0633e29 commit 6060160

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

include/RAJA/policy/openmp/atomic.hpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ RAJA_INLINE T atomicMin(omp_atomic, T *acc, T value)
101101
#pragma omp atomic capture compare
102102
{
103103
old = *acc;
104-
*acc = value < *acc ? value : *acc;
104+
if ( value < *acc )
105+
{
106+
*acc = value;
107+
}
105108
}
106109
return old;
107110
#else
@@ -120,7 +123,10 @@ RAJA_INLINE T atomicMax(omp_atomic, T *acc, T value)
120123
#pragma omp atomic capture compare
121124
{
122125
old = *acc;
123-
*acc = *acc < value ? value : *acc;
126+
if ( value > *acc )
127+
{
128+
*acc = value;
129+
}
124130
}
125131
return old;
126132
#else

0 commit comments

Comments
 (0)