未验证 提交 d91faf29 编写于 作者: F furnace 提交者: GitHub

bugfix for unit test test_segment_ops (#32116)

上级 8c7c53b3
...@@ -200,6 +200,8 @@ CUDA_ATOMIC_WRAPPER(Max, float) { ...@@ -200,6 +200,8 @@ CUDA_ATOMIC_WRAPPER(Max, float) {
old = atomicCAS(address_as_i, assumed, __float_as_int(val)); old = atomicCAS(address_as_i, assumed, __float_as_int(val));
} while (assumed != old); } while (assumed != old);
return __int_as_float(old);
} }
CUDA_ATOMIC_WRAPPER(Max, double) { CUDA_ATOMIC_WRAPPER(Max, double) {
...@@ -219,6 +221,8 @@ CUDA_ATOMIC_WRAPPER(Max, double) { ...@@ -219,6 +221,8 @@ CUDA_ATOMIC_WRAPPER(Max, double) {
old = atomicCAS(address_as_ull, assumed, __double_as_longlong(val)); old = atomicCAS(address_as_ull, assumed, __double_as_longlong(val));
} while (assumed != old); } while (assumed != old);
return __longlong_as_double(old);
} }
// For atomicMin // For atomicMin
...@@ -272,6 +276,8 @@ CUDA_ATOMIC_WRAPPER(Min, float) { ...@@ -272,6 +276,8 @@ CUDA_ATOMIC_WRAPPER(Min, float) {
old = atomicCAS(address_as_i, assumed, __float_as_int(val)); old = atomicCAS(address_as_i, assumed, __float_as_int(val));
} while (assumed != old); } while (assumed != old);
return __int_as_float(old);
} }
CUDA_ATOMIC_WRAPPER(Min, double) { CUDA_ATOMIC_WRAPPER(Min, double) {
...@@ -291,6 +297,8 @@ CUDA_ATOMIC_WRAPPER(Min, double) { ...@@ -291,6 +297,8 @@ CUDA_ATOMIC_WRAPPER(Min, double) {
old = atomicCAS(address_as_ull, assumed, __double_as_longlong(val)); old = atomicCAS(address_as_ull, assumed, __double_as_longlong(val));
} while (assumed != old); } while (assumed != old);
return __longlong_as_double(old);
} }
} // namespace platform } // namespace platform
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册