[FFmpeg-devel] [PATCH 2/3] Use clew instead of cl.h for OpenCL

Gupta, Maneesh Maneesh.Gupta at amd.com
Mon Feb 9 10:54:49 CET 2015



> -----Original Message-----
> From: ffmpeg-devel-bounces at ffmpeg.org [mailto:ffmpeg-devel-
> bounces at ffmpeg.org] On Behalf Of Dominik 'Rathann' Mierzejewski
> Sent: Friday, February 06, 2015 4:51 PM
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH 2/3] Use clew instead of cl.h for OpenCL
> 
> Hello, Maneesh.
> 
> On Friday, 06 February 2015 at 11:09, Gupta, Maneesh wrote:
> > Attached is the follow on patch that switches to using clew instead of
> > cl.h
> 
> What's the rationale to switch? cl.h is part of Khronos distribution while
> clew.h seems to be part of clcc with a couple of forks floating around the
> Internet. Is clew packaged in major distributions? It's definitely not in Fedora
> or Debian.
> 
> Regards,
> Dominik

My intention of this entire patch was to allow most systems to compile ffmpeg with OpenCL enabled.
Couple of problems with this today is that the location of OpenCL headers and libraries is not a standard nor is it easy to figure out this location across various platforms. As a result we need to tell ffmpeg the location of the Khronos OpenCL headers and libraries using --extra-cflags and --extra-ldflags in addition to using --enable-opencl.
Clew, used by several open source projects such as LibreOffice and Blender, helps in this regards by not having to depend on the OpenCL static library. Additionally by adding it to the ffmpeg source tree, we can completely avoid having to pass any additional options for enabling OpenCL, thereby achieving my original intent.
If you can suggest any better approach to achieving the intended goal, I can work on the required patch for the same.
Also if it helps, below is a response from Martijn who is maintaining clew for Blender.
------
Sergey and me forked clew as it was un-maintained and we wanted it to do OpenCL 1.2 at least. 
We host ours at https://github.com/OpenCLWrangler/clew and have the following plans for the future:

- Make more of the code auto generated from official Kronos headers
- Add OpenCL 2.0 support
- Keep it stable and help out where needed to enable our stakeholders ( maintainers of OSL / OpenSubDiv ) and users to have a seamless opencl enabled experience where possible.

We also have a similar library for Cuda's driver api and recently for loading SDL 2.

Since our use of OpenCL is currently mainly the compositor there has not been a lot of development in the passed year on the whole clew front.

I hope this helps you,

Martijn
------
Regards,
Maneesh
> --
> MPlayer http://mplayerhq.hu | RPM Fusion http://rpmfusion.org There
> should be a science of discontent. People need hard times and oppression to
> develop psychic muscles.
> 	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list