OpenCL wrangler: Update to latest version to fix issues with -1001 error code
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 29 Oct 2015 15:37:38 +0000 (20:37 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 29 Oct 2015 15:37:38 +0000 (20:37 +0500)
extern/clew/include/clew.h
extern/clew/src/clew.c

index 60a7c8f..1f79c12 100644 (file)
@@ -78,13 +78,13 @@ extern "C" {
     #define CL_API_SUFFIX__VERSION_1_0              AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
     #define CL_EXT_SUFFIX__VERSION_1_0              CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
     #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
-       #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
-       #define CL_API_SUFFIX__VERSION_1_1              CL_EXTENSION_WEAK_LINK
-       #define CL_EXT_SUFFIX__VERSION_1_1              CL_EXTENSION_WEAK_LINK
-       #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-       #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-       #define CL_API_SUFFIX__VERSION_1_2              CL_EXTENSION_WEAK_LINK
-       #define CL_EXT_SUFFIX__VERSION_1_2              CL_EXTENSION_WEAK_LINK
+    #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
+    #define CL_API_SUFFIX__VERSION_1_1              CL_EXTENSION_WEAK_LINK
+    #define CL_EXT_SUFFIX__VERSION_1_1              CL_EXTENSION_WEAK_LINK
+    #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
+    #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED   CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
+    #define CL_API_SUFFIX__VERSION_1_2              CL_EXTENSION_WEAK_LINK
+    #define CL_EXT_SUFFIX__VERSION_1_2              CL_EXTENSION_WEAK_LINK
 #else
     #define CL_EXTENSION_WEAK_LINK
     #define CL_API_SUFFIX__VERSION_1_0
@@ -2484,7 +2484,7 @@ PFNCLCREATEFROMGLTEXTURE3D)(cl_context      /* context */,
 #ifdef __APPLE__
 #  pragma GCC diagnostic pop // ignored "-Wignored-attributes"
 #endif
-       
+
 /* cl_khr_gl_sharing extension  */
 
 #define cl_khr_gl_sharing 1
index 8c9316d..e3adabd 100644 (file)
@@ -378,5 +378,15 @@ const char* clewErrorString(cl_int error)
         , "CL_INVALID_DEVICE_PARTITION_COUNT"           //  -68
     };
 
+    static const int num_errors = sizeof(strings) / sizeof(strings[0]);
+
+    if (error == -1001) {
+        return "CL_PLATFORM_NOT_FOUND_KHR";
+    }
+
+    if (error > 0 || -error >= num_errors) {
+        return "Unknown OpenCL error";
+    }
+
     return strings[-error];
 }