singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] dcslin commented on a change in pull request #758: update roundeven backend algorithm
Date Fri, 03 Jul 2020 00:33:51 GMT

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



Mime
View raw message