You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/12/27 19:24:41 UTC
[GitHub] sxjscience commented on a change in pull request #9200: Fix the gradient of gather_nd
sxjscience commented on a change in pull request #9200: Fix the gradient of gather_nd
URL: https://github.com/apache/incubator-mxnet/pull/9200#discussion_r158858084
##########
File path: src/common/cuda_utils.h
##########
@@ -479,6 +479,11 @@ static inline __device__ void atomicAdd(mshadow::half::half_t *address,
} while (assumed != old);
}
+// Overload atomicAdd to work for signed int64 on all architectures
+static inline __device__ void atomicAdd(int64_t *address, int64_t val) {
+ atomicAdd(reinterpret_cast<unsigned long long*>(address), static_cast<unsigned long long>(val)); // NOLINT
Review comment:
It should be safe if CUDA uses 2's complement to implement the signed long long.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services