<p dir="ltr">On Aug 30, 2014 5:17 PM, "Zhigang Gong" <<a href="mailto:zhigang.gong@gmail.com">zhigang.gong@gmail.com</a>> wrote:<br>
><br>
> This should be a generic requirement for some applications and I think<br>
> PyOpenCL should be supported by<br>
> beignet. This patch should be pushed into the upstream repo after got<br>
> reviewed. And if you can test it locally<br>
> and let us know whether it fix your issue. It will be helpful.<br>
><br>
> As to whether this could be merged into the fedora 21 release, I think<br>
> Igor may have official answer.<br>
> BTW, we are going to release a new fix version 0.9.3 in the coming<br>
> week after LLVM 3.5 released.<br>
> This patch should be included in 0.9.3.<br>
><br>
> Igor, is it possible to get the 0.9.3 into the Fedora 21 release?<br>
Yes, 0.9.3 will come to f21 after release.<br>
><br>
> Thanks,<br>
> Zhigang Gong<br>
><br>
><br>
> On Sat, Aug 30, 2014 at 8:46 PM, David Liebman<br>
> <<a href="mailto:david.c.liebman@gmail.com">david.c.liebman@gmail.com</a>> wrote:<br>
> ><br>
> > On 08/30/2014 04:47 AM, Zhigang Gong wrote:<br>
> >><br>
> >> Just got some time to try you example with PyOpenCL. And it seems that<br>
> >> PyOpenCL depends on<br>
> >> a function which we haven't implemented. After apply the following<br>
> >> patch, I can run your example<br>
> >> correctly. The output is as below:<br>
> >> gongzg@gongzg-MBA:~/Downloads$ python test.py<br>
> >> ('a', array([ 0.], dtype=float32))<br>
> >> ('b', array([ 0.], dtype=float32))<br>
> >> ('c', array([ 0.], dtype=float32))<br>
> >> 1 0.010514<br>
> >> ('a', array([ 0., 1.], dtype=float32))<br>
> >> ('b', array([ 0., 1.], dtype=float32))<br>
> >> ('c', array([ 0., 2.], dtype=float32))<br>
> >> 2 0.004235<br>
> >> ('a', array([ 0., 1., 2.], dtype=float32))<br>
> >> ('b', array([ 0., 1., 2.], dtype=float32))<br>
> >> ('c', array([ 0., 2., 4.], dtype=float32))<br>
> >> 3 0.004166<br>
> >><br>
> >><br>
> >> From 81c9e5cf70ec01197833f8722f6aa16632a5f1a4 Mon Sep 17 00:00:00 2001<br>
> >> From: Zhigang Gong <<a href="mailto:zhigang.gong@linux.intel.com">zhigang.gong@linux.intel.com</a>><br>
> >> Date: Sat, 30 Aug 2014 16:34:44 +0800<br>
> >> Subject: [PATCH] Runtime: Implement<br>
> >> clGetExtensionFunctionAddressForPlatform.<br>
> >><br>
> >> It seems that this function is required for PyOpenCL.<br>
> >><br>
> >> Signed-off-by: Zhigang Gong <<a href="mailto:zhigang.gong@linux.intel.com">zhigang.gong@linux.intel.com</a>><br>
> >> ---<br>
> >> src/cl_api.c | 19 +++++++++++++++++--<br>
> >> src/cl_khr_icd.c | 2 +-<br>
> >> 2 files changed, 18 insertions(+), 3 deletions(-)<br>
> >><br>
> >> diff --git a/src/cl_api.c b/src/cl_api.c<br>
> >> index 177a7e8..b463128 100644<br>
> >> --- a/src/cl_api.c<br>
> >> +++ b/src/cl_api.c<br>
> >> @@ -3156,8 +3156,8 @@ error:<br>
> >> if (strcmp(#x, func_name) == 0) \<br>
> >> return (void *)x;<br>
> >><br>
> >> -void*<br>
> >> -clGetExtensionFunctionAddress(const char *func_name)<br>
> >> +static void*<br>
> >> +internal_clGetExtensionFunctionAddress(const char *func_name)<br>
> >> {<br>
> >> if (func_name == NULL)<br>
> >> return NULL;<br>
> >> @@ -3180,6 +3180,21 @@ clGetExtensionFunctionAddress(const char<br>
> >> *func_name)<br>
> >> return NULL;<br>
> >> }<br>
> >><br>
> >> +void*<br>
> >> +clGetExtensionFunctionAddress(const char *func_name)<br>
> >> +{<br>
> >> + return internal_clGetExtensionFunctionAddress(func_name);<br>
> >> +}<br>
> >> +<br>
> >> +void*<br>
> >> +clGetExtensionFunctionAddressForPlatform(cl_platform_id platform,<br>
> >> + const char *func_name)<br>
> >> +{<br>
> >> + if (UNLIKELY(platform != NULL && platform != intel_platform))<br>
> >> + return NULL;<br>
> >> + return internal_clGetExtensionFunctionAddress(func_name);<br>
> >> +}<br>
> >> +<br>
> >> #undef EXTFUNC<br>
> >><br>
> >> cl_int<br>
> >> diff --git a/src/cl_khr_icd.c b/src/cl_khr_icd.c<br>
> >> index 6d49db0..50a0898 100644<br>
> >> --- a/src/cl_khr_icd.c<br>
> >> +++ b/src/cl_khr_icd.c<br>
> >> @@ -154,7 +154,7 @@ struct _cl_icd_dispatch const cl_khr_icd_dispatch = {<br>
> >> clEnqueueMigrateMemObjects,<br>
> >> clEnqueueMarkerWithWaitList,<br>
> >> clEnqueueBarrierWithWaitList,<br>
> >> - CL_1_2_NOTYET(clGetExtensionFunctionAddressForPlatform),<br>
> >> + clGetExtensionFunctionAddressForPlatform,<br>
> >> CL_GL_INTEROP(clCreateFromGLTexture),<br>
> >> (void *) NULL,<br>
> >> (void *) NULL,<br>
> ><br>
> > This is great. Thank you greatly for the patch. Now, should I be waiting for<br>
> > a new beignet package from fedora, or should I 'roll my own' and start<br>
> > compiling from source, adding the patch myself? I would love this to make it<br>
> > to the fedora 21 release, but I don't know what that would take. What is<br>
> > normal procedure? Is there a need for this method in the general community,<br>
> > or am I the only one who's interested in this feature?<br>
> ><br>
> > -Dave L.<br>
--<br>
-Igor Gnatenko</p>