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 18:56:51 UTC

[GitHub] piiswrong commented on a change in pull request #9200: Fix the gradient of gather_nd

piiswrong commented on a change in pull request #9200: Fix the gradient of gather_nd
URL: https://github.com/apache/incubator-mxnet/pull/9200#discussion_r158855265
 
 

 ##########
 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:
   are you sure this works for negative value?

----------------------------------------------------------------
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