summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2014-08-30 16:34:44 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-09-10 15:00:43 +0800
commitddc0c25adc2c27450e7296cfc0b4931129280081 (patch)
tree58bd4241f4f575bef2e2bcd8990c766f88c3ce73
parentb94489f56ee3af3fc0eb32acade484db984120d3 (diff)
Runtime: Implement clGetExtensionFunctionAddressForPlatform.
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>
-rw-r--r--src/cl_api.c19
-rw-r--r--src/cl_khr_icd.c2
2 files changed, 18 insertions, 3 deletions
diff --git a/src/cl_api.c b/src/cl_api.c
index 2370dc04..a8a4b741 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -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
diff --git a/src/cl_khr_icd.c b/src/cl_khr_icd.c
index 6d49db03..50a08989 100644
--- a/src/cl_khr_icd.c
+++ b/src/cl_khr_icd.c
@@ -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,