Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support CL_PLATFORM_NOT_FOUND_KHR error.

Khronos .icd extension may report error when no platform is
found. This patch essentially provides a friendly error message like:
*** Exception: CL_PLATFORM_NOT_FOUND_KHR

Previously it was just an error code:
*** Exception: CLError.toEnum: Cannot match -1001
  • Loading branch information...
commit 0044ee762ef17404a8ff4aeb697e067456772b67 1 parent c134107
@mgajda mgajda authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/Control/Parallel/OpenCL/Types.chs
View
5 src/Control/Parallel/OpenCL/Types.chs
@@ -65,6 +65,7 @@ import Control.Exception( Exception(..), throwIO )
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
+#include <CL/cl_ext.h>
#endif
-- -----------------------------------------------------------------------------
@@ -115,6 +116,7 @@ type CLAddressingMode_ = {#type cl_addressing_mode#}
-- -----------------------------------------------------------------------------
#c
enum CLError {
+ cL_PLATFORM_NOT_FOUND_KHR=CL_PLATFORM_NOT_FOUND_KHR,
cL_BUILD_PROGRAM_FAILURE=CL_BUILD_PROGRAM_FAILURE,
cL_COMPILER_NOT_AVAILABLE=CL_COMPILER_NOT_AVAILABLE,
cL_DEVICE_NOT_AVAILABLE=CL_DEVICE_NOT_AVAILABLE,
@@ -177,6 +179,9 @@ available.
* 'CL_DEVICE_NOT_FOUND', Returned if no OpenCL devices that match the specified
devices were found.
+ * 'CL_PLATFORM_NOT_FOUND_khr', Returned when no .icd (platform drivers)
+ can be properly loaded.
+
* 'CL_IMAGE_FORMAT_MISMATCH', Returned if the specified source and destination
images are not valid image objects.
Please sign in to comment.
Something went wrong with that request. Please try again.