From 0118a372252180fb6b8c597dd0874fb31b477435 Mon Sep 17 00:00:00 2001 From: Simon Richter Date: Wed, 3 Apr 2013 20:32:45 +0200 Subject: Implement KHR ICD extension This adds a pointer to the dispatch table at the beginning of every object of type - cl_command_queue - cl_context - cl_device_id - cl_event - cl_kernel - cl_mem - cl_platform_id - cl_program - cl_sampler as required by the ICD specification. The layout of the dispatch table comes from the OpenCL ICD loader by Brice Videau and Vincent Danjean . To avoid dispatch table entries being overwritten with the ICD loader's implementations of the CL functions (as would be the proper behaviour for the ELF loader), the -Bsymbolic option is given to the linker. Signed-off-by: Zhigang Gong --- CMake/FindOCLIcd.cmake | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 CMake/FindOCLIcd.cmake (limited to 'CMake') diff --git a/CMake/FindOCLIcd.cmake b/CMake/FindOCLIcd.cmake new file mode 100644 index 00000000..076f00e5 --- /dev/null +++ b/CMake/FindOCLIcd.cmake @@ -0,0 +1,23 @@ +# +# Try to find ocl_icd library and include path. +# Once done this will define +# +# OCLIcd_FOUND +# OCLIcd_INCLUDE_PATH +# + +FIND_PATH(OCLIcd_INCLUDE_PATH ocl_icd.h + ~/include/ + /usr/include/ + /usr/local/include/ + /sw/include/ + /opt/local/include/ + DOC "The directory where ocl_icd.h resides") + +IF(OCLIcd_INCLUDE_PATH) + SET(OCLIcd_FOUND 1 CACHE STRING "Set to 1 if OCLIcd is found, 0 otherwise") +ELSE(OCLIcd_INCLUDE_PATH) + SET(OCLIcd_FOUND 0 CACHE STRING "Set to 1 if OCLIcd is found, 0 otherwise") +ENDIF(OCLIcd_INCLUDE_PATH) + +MARK_AS_ADVANCED(OCLIcd_FOUND) -- cgit v1.2.1