diff --git a/libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_derived.h b/libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_derived.h index 06e965d4a2..93d4143129 100644 --- a/libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_derived.h +++ b/libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_derived.h @@ -249,7 +249,7 @@ static inline _CCCL_DEVICE void __cuda_atomic_fetch_max(_Type* __ptr, _Type& __d __dst = __cuda_atomic_fetch_update( __ptr, [__op](_Type __old) { - return __old > __op ? __old : __op; + return __op < __old ? __old : __op; }, _Order{}, __atomic_cuda_operand_tag<__atomic_cuda_operand::_b, _Operand::__size>{},