singa-dev mailing list archives

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

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



##########
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:
       I guess there is no need to change the `auto`, `auto` seems to be a good way to prevent
implicit type casting (sometime developer us could be careless). The only problem of `auto`
is just the code readability for the developer to know the exact datatype.
   
   In any case, I think need to keep the same version of complier between the docker version
and conda version (as in #759), because a few day ago we had the similar complier error because
of the version different.  
   




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