[opencv] 209/251: dnn: force floating point literals to be float.

Nobuhiro Iwamatsu iwamatsu at moszumanska.debian.org
Sun Aug 27 23:27:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

iwamatsu pushed a commit to annotated tag 3.3.0
in repository opencv.

commit c2de5cf735d46f5ad67fb8cef7ea4b9909c98dfa
Author: Ismo Puustinen <ismo.puustinen at intel.com>
Date:   Tue Aug 1 14:09:11 2017 +0300

    dnn: force floating point literals to be float.
    
    In OpenCL code in activations.cl, make the type of floating point
    literals to be float. Otherwise the values will be interpreted as
    doubles, causing Beignet to have type conversion issues.
---
 modules/dnn/src/opencl/activations.cl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/dnn/src/opencl/activations.cl b/modules/dnn/src/opencl/activations.cl
index 58da4db..b98e52f 100644
--- a/modules/dnn/src/opencl/activations.cl
+++ b/modules/dnn/src/opencl/activations.cl
@@ -21,13 +21,13 @@ __kernel void TanHForward(const int count, __global T* in, __global T* out) {
 __kernel void SigmoidForward(const int count, __global const T* in, __global T* out) {
   int index = get_global_id(0);
   if(index < count)
-  out[index] = 1. / (1. + exp(-in[index]));
+  out[index] = 1.0f / (1.0f + exp(-in[index]));
 }
 
 __kernel void BNLLForward(const int n, __global const T* in, __global T* out) {
   int index = get_global_id(0);
   if (index < n) {
-    out[index] = in[index] > 0 ? in[index] + log(1. + exp(-in[index])) : log(1. + exp(in[index]));
+    out[index] = in[index] > 0 ? in[index] + log(1.0f + exp(-in[index])) : log(1.0f + exp(in[index]));
   }
 }
 
@@ -41,4 +41,4 @@ __kernel void PowForward(const int n, __global const T* in, __global T* out, con
   int index = get_global_id(0);
   if (index < n)
     out[index] = pow(shift + scale * in[index], power);
-}
\ No newline at end of file
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list