[gegl] opencl: bug in opencl enable flag



commit f474d851c4bd51cd353a514385f9f98a69f5032d
Author: Victor Oliveira <victormatheus gmail com>
Date:   Mon Apr 23 12:06:49 2012 -0300

    opencl: bug in opencl enable flag

 gegl/opencl/gegl-cl-init.c    |    3 ++-
 gegl/process/gegl-processor.c |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gegl/opencl/gegl-cl-init.c b/gegl/opencl/gegl-cl-init.c
index ee9d978..67885ed 100644
--- a/gegl/opencl/gegl-cl-init.c
+++ b/gegl/opencl/gegl-cl-init.c
@@ -11,6 +11,7 @@
 #include "gegl-cl-color.h"
 
 #include "gegl/gegl-debug.h"
+#include "gegl-config.h"
 
 const char *gegl_cl_errstring(cl_int err) {
   static const char* strings[] =
@@ -91,7 +92,7 @@ static GHashTable *cl_program_hash = NULL;
 gboolean
 gegl_cl_is_accelerated (void)
 {
-  return cl_state.is_accelerated;
+  return cl_state.is_accelerated && gegl_config()->use_opencl;
 }
 
 cl_platform_id
diff --git a/gegl/process/gegl-processor.c b/gegl/process/gegl-processor.c
index 05f7985..69b1247 100644
--- a/gegl/process/gegl-processor.c
+++ b/gegl/process/gegl-processor.c
@@ -749,7 +749,7 @@ gegl_processor_work (GeglProcessor *processor,
   gboolean   more_work = FALSE;
   GeglCache *cache     = gegl_node_get_cache (processor->input);
 
-  if (gegl_cl_is_accelerated () && gegl_config()->use_opencl
+  if (gegl_cl_is_accelerated ()
       && processor->chunk_size != GEGL_CL_CHUNK_SIZE)
     {
       GeglVisitor *visitor = g_object_new (GEGL_TYPE_VISITOR, NULL);



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