[gegl] gegl: pick the first opencl platform with image support



commit f3adb089fae7d06f473ee39b1475d8fd13f882ca
Author: Richard B. Kreckel <kreckel in terlu de>
Date:   Sun Jan 20 18:34:37 2019 +0100

    gegl: pick the first opencl platform with image support
    
    Fixing issue #117

 gegl/opencl/gegl-cl-init.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gegl/opencl/gegl-cl-init.c b/gegl/opencl/gegl-cl-init.c
index 322cab0ba..22bdbb849 100644
--- a/gegl/opencl/gegl-cl-init.c
+++ b/gegl/opencl/gegl-cl-init.c
@@ -599,8 +599,13 @@ gegl_cl_init_load_device_info (cl_platform_id   platform,
         {
           platform = platforms[platform_idx];
           err = gegl_clGetDeviceIDs (platform, requested_device_type, 1, &device, NULL);
-          if (err == CL_SUCCESS)
+          if (err == CL_SUCCESS) {
+            cl_bool tmp_image_support = FALSE;
+            err = gegl_clGetDeviceInfo (device, CL_DEVICE_IMAGE_SUPPORT, sizeof(cl_bool), 
&tmp_image_support, NULL);
+            if (err == CL_SUCCESS && tmp_image_support == FALSE)
+              continue;
             break;
+          }
         }
 
       g_free (platforms);


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