[gegl/gsoc2011-opencl-2: 15/19] GeglOperator and OpenCL
- From: Victor Matheus de Araujo Oliveira <vmaolive src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/gsoc2011-opencl-2: 15/19] GeglOperator and OpenCL
- Date: Mon, 21 Nov 2011 19:00:33 +0000 (UTC)
commit d2c047c3e1c9d9663d04f774fec43cc446d9bb9a
Author: Victor Oliveira <victormatheus gmail com>
Date: Fri Nov 18 17:05:57 2011 -0200
GeglOperator and OpenCL
GeglOperator doesn't cut up ROIs if a processing node is detected to
have an dependent node which supports OpenCL.
This is because tiling has too much overhead in the GPU.
gegl/process/gegl-processor.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gegl/process/gegl-processor.c b/gegl/process/gegl-processor.c
index 6f377ef..e36e8cd 100644
--- a/gegl/process/gegl-processor.c
+++ b/gegl/process/gegl-processor.c
@@ -32,6 +32,8 @@
#include "gegl-types-internal.h"
#include "gegl-utils.h"
+#include "graph/gegl-visitor.h"
+#include "graph/gegl-visitable.h"
enum
{
@@ -737,6 +739,23 @@ gegl_processor_work (GeglProcessor *processor,
gboolean more_work = FALSE;
GeglCache *cache = gegl_node_get_cache (processor->input);
+ /* OpenCL params */
+ GeglVisitor *visitor = g_object_new (GEGL_TYPE_VISITOR, NULL);
+ GSList *iterator = NULL;
+ GSList *visits_list = NULL;
+ gegl_visitor_reset (visitor);
+ gegl_visitor_dfs_traverse (visitor, GEGL_VISITABLE (processor->node));
+ visits_list = gegl_visitor_get_visits_list (visitor);
+
+ for (iterator = visits_list; iterator; iterator = iterator->next)
+ {
+ GeglNode *node = (GeglNode*) iterator->data;
+ if (GEGL_OPERATION_GET_CLASS(node->operation)->opencl_support)
+ {
+ processor->chunk_size = INT_MAX;
+ }
+ }
+
more_work = gegl_processor_render (processor, &processor->rectangle, progress);
if (more_work)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]