[gegl] gegl: only flush cl caches when cl is enabled
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl: only flush cl caches when cl is enabled
- Date: Wed, 15 Nov 2017 03:26:17 +0000 (UTC)
commit 976b8be524ea91fdde7cfc5d08f7e7c732673f34
Author: Øyvind Kolås <pippin gimp org>
Date: Wed Nov 15 03:38:13 2017 +0100
gegl: only flush cl caches when cl is enabled
gegl/operation/gegl-operation-point-composer.c | 11 +++++++----
gegl/operation/gegl-operation-point-composer3.c | 15 +++++++++------
gegl/operation/gegl-operation-point-filter.c | 2 +-
perf/test-scale.c | 5 ++++-
4 files changed, 21 insertions(+), 12 deletions(-)
---
diff --git a/gegl/operation/gegl-operation-point-composer.c b/gegl/operation/gegl-operation-point-composer.c
index b3763fe..0a1a83a 100644
--- a/gegl/operation/gegl-operation-point-composer.c
+++ b/gegl/operation/gegl-operation-point-composer.c
@@ -343,10 +343,13 @@ gegl_operation_point_composer_process (GeglOperation *operation,
}
pending = threads;
- if (input)
- gegl_buffer_cl_cache_flush (input, result);
- if (aux)
- gegl_buffer_cl_cache_flush (aux, result);
+ if (gegl_cl_is_accelerated ())
+ {
+ if (input)
+ gegl_buffer_cl_cache_flush (input, result);
+ if (aux)
+ gegl_buffer_cl_cache_flush (aux, result);
+ }
for (gint j = 1; j < threads; j++)
g_thread_pool_push (pool, &thread_data[j], NULL);
diff --git a/gegl/operation/gegl-operation-point-composer3.c b/gegl/operation/gegl-operation-point-composer3.c
index d1bf967..8d6e81b 100644
--- a/gegl/operation/gegl-operation-point-composer3.c
+++ b/gegl/operation/gegl-operation-point-composer3.c
@@ -258,12 +258,15 @@ gegl_operation_point_composer3_process (GeglOperation *operation,
}
pending = threads;
- if (input)
- gegl_buffer_cl_cache_flush (input, result);
- if (aux)
- gegl_buffer_cl_cache_flush (aux, result);
- if (aux2)
- gegl_buffer_cl_cache_flush (aux2, result);
+ if (gegl_cl_is_accelerated ())
+ {
+ if (input)
+ gegl_buffer_cl_cache_flush (input, result);
+ if (aux)
+ gegl_buffer_cl_cache_flush (aux, result);
+ if (aux2)
+ gegl_buffer_cl_cache_flush (aux2, result);
+ }
for (gint j = 1; j < threads; j++)
g_thread_pool_push (pool, &thread_data[j], NULL);
diff --git a/gegl/operation/gegl-operation-point-filter.c b/gegl/operation/gegl-operation-point-filter.c
index d0d69dc..c20ca3e 100644
--- a/gegl/operation/gegl-operation-point-filter.c
+++ b/gegl/operation/gegl-operation-point-filter.c
@@ -315,7 +315,7 @@ gegl_operation_point_filter_process (GeglOperation *operation,
pending = threads;
- if (input)
+ if (gegl_cl_is_accelerated () && input)
gegl_buffer_cl_cache_flush (input, result);
for (gint j = 1; j < threads; j++)
diff --git a/perf/test-scale.c b/perf/test-scale.c
index f326730..e34f7c9 100644
--- a/perf/test-scale.c
+++ b/perf/test-scale.c
@@ -27,7 +27,10 @@ void scale(GeglBuffer *buffer)
gegl = gegl_node_new ();
source = gegl_node_new_child (gegl, "operation", "gegl:buffer-source", "buffer", buffer, NULL);
- scale = gegl_node_new_child (gegl, "operation", "gegl:scale-ratio", "x", 0.4, "y", 0.4, NULL);
+ scale = gegl_node_new_child (gegl, "operation", "gegl:scale-ratio", "x", 0.4, "y", 0.4,
+ "sampler", GEGL_SAMPLER_LINEAR,
+
+NULL);
sink = gegl_node_new_child (gegl, "operation", "gegl:buffer-sink", "buffer", &buffer2, NULL);
gegl_node_link_many (source, scale, sink, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]