Add cl*Intel to extension function lookup
authorSimon Richter <Simon.Richter@hogyros.de>
Mon, 22 Apr 2013 09:26:26 +0000 (11:26 +0200)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Mon, 22 Apr 2013 10:04:24 +0000 (18:04 +0800)
This allows applications to look up the extension functions when going
through the ICD loader.

Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
src/cl_api.c

index 00036da..03cc0e6 100644 (file)
@@ -1170,6 +1170,10 @@ clEnqueueBarrier(cl_command_queue  command_queue)
   return 0;
 }
 
+#define EXTFUNC(x)                      \
+  if (strcmp(#x, func_name) == 0)       \
+    return (void *)x;
+
 void*
 clGetExtensionFunctionAddress(const char *func_name)
 {
@@ -1177,12 +1181,22 @@ clGetExtensionFunctionAddress(const char *func_name)
     return NULL;
 #ifdef HAS_OCLIcd
   /* cl_khr_icd */
-  if (strcmp("clIcdGetPlatformIDsKHR", func_name) == 0)
-    return (void *)clIcdGetPlatformIDsKHR;
+  EXTFUNC(clIcdGetPlatformIDsKHR)
 #endif
+  EXTFUNC(clCreateProgramWithLLVMIntel)
+  EXTFUNC(clGetGenVersionIntel)
+  EXTFUNC(clMapBufferIntel)
+  EXTFUNC(clUnmapBufferIntel)
+  EXTFUNC(clMapBufferGTTIntel)
+  EXTFUNC(clUnmapBufferGTTIntel)
+  EXTFUNC(clPinBufferIntel)
+  EXTFUNC(clUnpinBufferIntel)
+  EXTFUNC(clReportUnfreedIntel)
   return NULL;
 }
 
+#undef EXTFUNC
+
 cl_int
 clReportUnfreedIntel(void)
 {