Runtime: Implement clGetExtensionFunctionAddressForPlatform.
authorZhigang Gong <zhigang.gong@linux.intel.com>
Sat, 30 Aug 2014 08:34:44 +0000 (16:34 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Wed, 10 Sep 2014 07:00:43 +0000 (15:00 +0800)
It seems that this function is required by latest PyOpenCL.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
src/cl_api.c
src/cl_khr_icd.c

index 2370dc0..a8a4b74 100644 (file)
@@ -3157,8 +3157,8 @@ error:
   if (strcmp(#x, func_name) == 0)       \
     return (void *)x;
 
-void*
-clGetExtensionFunctionAddress(const char *func_name)
+static void*
+internal_clGetExtensionFunctionAddress(const char *func_name)
 {
   if (func_name == NULL)
     return NULL;
@@ -3181,6 +3181,21 @@ clGetExtensionFunctionAddress(const char *func_name)
   return NULL;
 }
 
+void*
+clGetExtensionFunctionAddress(const char *func_name)
+{
+  return internal_clGetExtensionFunctionAddress(func_name);
+}
+
+void*
+clGetExtensionFunctionAddressForPlatform(cl_platform_id platform,
+                              const char *func_name)
+{
+  if (UNLIKELY(platform != NULL && platform != intel_platform))
+    return NULL;
+  return internal_clGetExtensionFunctionAddress(func_name);
+}
+
 #undef EXTFUNC
 
 cl_int
index 6d49db0..50a0898 100644 (file)
@@ -154,7 +154,7 @@ struct _cl_icd_dispatch const cl_khr_icd_dispatch = {
   clEnqueueMigrateMemObjects,
   clEnqueueMarkerWithWaitList,
   clEnqueueBarrierWithWaitList,
-  CL_1_2_NOTYET(clGetExtensionFunctionAddressForPlatform),
+  clGetExtensionFunctionAddressForPlatform,
   CL_GL_INTEROP(clCreateFromGLTexture),
   (void *) NULL,
   (void *) NULL,