diff options
-rw-r--r-- | extern/clew/include/clew.h | 16 | ||||
-rw-r--r-- | extern/clew/src/clew.c | 10 |
2 files changed, 18 insertions, 8 deletions
diff --git a/extern/clew/include/clew.h b/extern/clew/include/clew.h index 60a7c8fba98..1f79c12481b 100644 --- a/extern/clew/include/clew.h +++ b/extern/clew/include/clew.h @@ -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 diff --git a/extern/clew/src/clew.c b/extern/clew/src/clew.c index 8c9316d3c9c..e3adabd829c 100644 --- a/extern/clew/src/clew.c +++ b/extern/clew/src/clew.c @@ -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]; } |