You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@singa.apache.org by GitBox <gi...@apache.org> on 2020/07/03 00:33:51 UTC

[GitHub] [singa] dcslin commented on a change in pull request #758: update roundeven backend algorithm

dcslin commented on a change in pull request #758:
URL: https://github.com/apache/singa/pull/758#discussion_r449322587



##########
File path: src/core/tensor/math_kernel.cu
##########
@@ -140,7 +140,12 @@ __global__ void KernelRound(const size_t n, const float *in, float *out) {
 __global__ void KernelRoundE(const size_t n, const float *in, float *out) {
   for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < n;
        i += blockDim.x * gridDim.x) {
-    out[i] = roundf(in[i]/2)*2;
+    auto doub = in[i]*2;

Review comment:
       Thank you Chris for the prompt response! I could also replace the `auto` in this PR. Yes I think updating to newer gcc is a good idea, although the "new"(c++11) one is already widely used and not that new, it would be helpful to support running c++11 code. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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