[gegl] cl: A reasonable chunk_size for OpenCL



commit 06aed852fad573945f8779f4be17f466fd154547
Author: Victor Oliveira <victormatheus gmail com>
Date:   Sun Apr 1 15:00:23 2012 -0300

    cl: A reasonable chunk_size for OpenCL

 gegl/opencl/gegl-cl-init.h    |    2 ++
 gegl/process/gegl-processor.c |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gegl/opencl/gegl-cl-init.h b/gegl/opencl/gegl-cl-init.h
index a50d62a..8445ae8 100644
--- a/gegl/opencl/gegl-cl-init.h
+++ b/gegl/opencl/gegl-cl-init.h
@@ -60,6 +60,8 @@ typedef struct
 gegl_cl_run_data *gegl_cl_compile_and_build (const char *program_source,
                                              const char *kernel_name[]);
 
+#define GEGL_CL_CHUNK_SIZE 1024 * 1024
+
 #ifdef __GEGL_CL_INIT_MAIN__
 
 t_clGetPlatformIDs  gegl_clGetPlatformIDs  = NULL;
diff --git a/gegl/process/gegl-processor.c b/gegl/process/gegl-processor.c
index c66e82a..44702aa 100644
--- a/gegl/process/gegl-processor.c
+++ b/gegl/process/gegl-processor.c
@@ -750,7 +750,7 @@ gegl_processor_work (GeglProcessor *processor,
   GeglCache *cache     = gegl_node_get_cache (processor->input);
 
   if (gegl_cl_is_accelerated () && gegl_config()->use_opencl
-      && processor->chunk_size < INT_MAX)
+      && processor->chunk_size != GEGL_CL_CHUNK_SIZE)
     {
       GeglVisitor *visitor = g_object_new (GEGL_TYPE_VISITOR, NULL);
       GSList *iterator = NULL;
@@ -764,7 +764,7 @@ gegl_processor_work (GeglProcessor *processor,
           GeglNode *node = (GeglNode*) iterator->data;
           if (GEGL_OPERATION_GET_CLASS(node->operation)->opencl_support)
             {
-              processor->chunk_size = INT_MAX;
+              processor->chunk_size = GEGL_CL_CHUNK_SIZE;
               break;
             }
         }



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