[gegl] threshold: use the same comparison in opencl kernel and cpu implementation



commit 2cf9bdb93c8cb114d4ea6033ad5f8226e2179d58
Author: Thomas Manni <thomas manni free fr>
Date:   Sun Sep 24 21:08:24 2017 +0200

    threshold: use the same comparison in opencl kernel and cpu implementation
    
    cpu implementation uses "superior or equal" to produce a white pixel, so
    use the same comparison in the opencl kernel

 opencl/threshold.cl   |    2 +-
 opencl/threshold.cl.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/opencl/threshold.cl b/opencl/threshold.cl
index a546290..6f0e4f2 100644
--- a/opencl/threshold.cl
+++ b/opencl/threshold.cl
@@ -7,7 +7,7 @@ __kernel void gegl_threshold (__global const float2     *in,
   float2 in_v  = in [gid];
   float  aux_v = (aux)? aux[gid] : value;
   float2 out_v;
-  out_v.x = (in_v.x > aux_v)? 1.0f : 0.0f;
+  out_v.x = (in_v.x >= aux_v)? 1.0f : 0.0f;
   out_v.y = in_v.y;
   out[gid]  =  out_v;
 }
diff --git a/opencl/threshold.cl.h b/opencl/threshold.cl.h
index d14148f..8f2874f 100644
--- a/opencl/threshold.cl.h
+++ b/opencl/threshold.cl.h
@@ -8,7 +8,7 @@ static const char* threshold_cl_source =
 "  float2 in_v  = in [gid];                                                    \n"
 "  float  aux_v = (aux)? aux[gid] : value;                                     \n"
 "  float2 out_v;                                                               \n"
-"  out_v.x = (in_v.x > aux_v)? 1.0f : 0.0f;                                    \n"
+"  out_v.x = (in_v.x >= aux_v)? 1.0f : 0.0f;                                   \n"
 "  out_v.y = in_v.y;                                                           \n"
 "  out[gid]  =  out_v;                                                         \n"
 "}                                                                             \n"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]