[gegl] tests: do not print cpu numbers for opencl when opencl is not available



commit c9204c585d77187c62287a69e3920b05bffd4a8b
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Jan 14 17:01:12 2017 +0100

    tests: do not print cpu numbers for opencl when opencl is not available
    
    Contributed by Sergey "Shnatsel" Davidoff shnatsel gmail com bug 777252 for
    details.

 perf/test-common.h |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/perf/test-common.h b/perf/test-common.h
index 26a1b7f..5bc1195 100644
--- a/perf/test-common.h
+++ b/perf/test-common.h
@@ -1,6 +1,7 @@
 #include <stdlib.h>
 #include <glib.h>
 #include "gegl.h"
+#include "gegl/opencl/gegl-cl-init.h"
 
 static long ticks_start;
 
@@ -75,8 +76,13 @@ void do_bench (const gchar *id,
                "use-opencl", opencl,
                NULL);
 
-  if (opencl)
+  if (opencl) {
+    if ( ! gegl_cl_is_accelerated()) {
+      g_print("OpenCL is disabled. Skipping OpenCL test\n");
+      return;
+    }
     suffix = " (OpenCL)";
+  }
 
   // warm up
   test_func(buffer);


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