[FFmpeg-devel] [PATCH] is_compiled flag not being cleared in av_opencl_uninit

Michael Niedermayer michaelni at gmx.at
Sat Mar 7 10:24:07 CET 2015


On Fri, Mar 06, 2015 at 03:30:00PM +0100, Michael Niedermayer wrote:
> On Fri, Mar 06, 2015 at 07:34:06PM +0800, Wei Gao wrote:
> > 2015-03-05 8:48 GMT+08:00 Srikanth G <gskanth at gmail.com>:
> > 
> > > When OpenCL kernels are compiled, is_compiled flag is being set for each
> > > kernel. But, in opencl uninit, this flag is not being cleared.
> > > This causes an error when an OpenCL kernel is tried on different OpenCL
> > > devices on same platform.
> > >
> > > Here is the patch with a fix
> > >
> > > ---
> > >  libavutil/opencl.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/libavutil/opencl.c b/libavutil/opencl.c
> > > index 36cb6fe..a56029c 100644
> > > --- a/libavutil/opencl.c
> > > +++ b/libavutil/opencl.c
> > > @@ -611,6 +611,9 @@ void av_opencl_uninit(void)
> > >          }
> > >          opencl_ctx.context = NULL;
> > >      }
> > > + for (i = 0; i < opencl_ctx.kernel_code_count; i++) {
> > > +        opencl_ctx.kernel_code[i].is_compiled = 0;
> > > +    }
> > >      free_device_list(&opencl_ctx.device_list);
> > >  end:
> > >      if (opencl_ctx.init_count <= 0)
> > >
> > > Please incorporate this change.
> > > Let me know if more info is needed regarding this.
> > >
> > Looks good to me.
> 
> applied

reverted, this patch broke compilation with opencl

[...]


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150307/50376f15/attachment.asc>


More information about the ffmpeg-devel mailing list