<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Over the summer I rewrote the warper to use OpenCL. There was a 2x to 50x speedup. Here is a description of what I did:<br><a href="http://osgeo-org.1803224.n2.nabble.com/gdal-dev-gdalwarp-OpenCL-Performance-Week-9-td5341226.html">http://osgeo-org.1803224.n2.nabble.com/gdal-dev-gdalwarp-OpenCL-Performance-Week-9-td5341226.html</a><br><br>~Seth<br><div><div><br></div><div><br></div><div><br></div><div>On Dec 6, 2010, at 5:10 AM, Konstantin Baumann wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br><br>what benefit/improvement would the OpenCL integration bring to GDAL? Additional functionality or a speedup of existing functions? Probably only operations on images and/or rasters are supported; reprojection/warping and filtering would be good candidates, right? What concrete operations would be supported?<br><br>Kosta<br><br>-----Original Message-----<br>From: gdal-dev-bounces@lists.osgeo.org [<a href="mailto:gdal-dev-bounces@lists.osgeo.org">mailto:gdal-dev-bounces@lists.osgeo.org</a>] On Behalf Of Frank Warmerdam (External)<br>Sent: Monday, December 06, 2010 1:43 AM<br>To: Seth Price<br>Cc: Philippe Vachon; gdal-dev; Wolf Bergenheim<br>Subject: [gdal-dev] Re: OpenCL, GRASS, GDAL, and You<br><br>On 10-09-23 10:09 AM, Seth Price wrote:<br><blockquote type="cite">Hey all, I was just wondering if there was any progress in integrating<br></blockquote><blockquote type="cite">the OpenCL code into trunk in each project? I haven't heard anything,<br></blockquote><blockquote type="cite">but it would be a shame to just leave the code sit, or wait until the<br></blockquote><blockquote type="cite">code branches have significantly diverged.<br></blockquote><blockquote type="cite">~Seth<br></blockquote><blockquote type="cite"><br></blockquote><br>Seth,<br><br>Last week I went out and bought a new AMD/ATI machine in the hopes (amoung<br>other goals) that OpenCL would work on it with the ATI OpenCL SDK.<br>Unfortunately I have discovered that the ATI Radion 4200 HD is not supported<br>for OpenCL stuff. &nbsp;:-(<br><br>Nevertheless, with some persistance I was able to build the ATI SDK, and<br>configure GDAL to build against it. &nbsp;So I have integrated OpenCL support<br>in trunk. &nbsp;It is not enabled by default, but you can enable it with the<br>--with-opencl directive. &nbsp;If the include files and libraries are in a<br>non-standard location you can also use the --with-opencl-include and<br>--with-opencl-lib directives to configure like this:<br><br> &nbsp;&nbsp;&nbsp;&nbsp;--with-opencl \<br> &nbsp;&nbsp;&nbsp;&nbsp;--with-opencl-include=/home/warmerda/pkg/ati-stream-sdk-v2.2-lnx64/include \<br><br>--with-opencl-lib="-L/home/warmerda/pkg/ati-stream-sdk-v2.2-lnx64/lib/x86_64 <br>-lOpenCL" \<br><br>I ran into a few issues:<br><br>1) It seems the include file from ATI is &lt;cl/opencl.h&gt; not &lt;OpenCL/OpenCL.h&gt;<br>as it is on the Mac. &nbsp;I've put a platform dependent ifdef but I don't now<br>what the situation will be on other machines.<br><br>2) In your get_device() function you were passing NULL in for the platform.<br>The online docs indicate this as an option but warn that behavior then is<br>platform dependent. &nbsp;The ATI SDK just fails with an invalid platform error.<br>So I updated the code to fetch a platform id and use that.<br><br>3) On my system it falls back to using the CPU but it turns out the CPU<br>does not offer "image" support in my case. &nbsp;I added some extra logic to<br>look for this capability so a better error could be reported.<br><br>4) I restructured things a bit so that the OpenCL warper case can return<br>CE_Warning to indicate to the high level warper that OpenCL should be<br>skipped and other mechanisms used. &nbsp;That is what it does not if it fails<br>to find a suitable device, or some of the other specific checks.<br><br>5) I made a few changes to use CPLDebug instead of printf for debug output.<br><br>I haven't tried this yet on your Mac. &nbsp;I avoided using the account you<br>kindly offered because I find the Mac is often a perverse build environment<br>and I didn't want to establish the "norm" based on it. &nbsp;I might try it out<br>tonight though.<br><br>I have also not yet tried it on windows, and likely won't in the near future.<br>Perhaps someone else will pick up the ball there. &nbsp;The code itself just<br>depends on having HAVE_OPENCL defined at least in the alg directory and<br>of course appropriate include and link options.<br><br>(cc:ed to the list so everyone is aware of the availability).<br><br>Best regards,<br>-- <br>---------------------------------------+--------------------------------------<br>I set the clouds in motion - turn up &nbsp;&nbsp;| Frank Warmerdam, <a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a><br>light and sound - activate the windows | <a href="http://pobox.com/~warmerdam">http://pobox.com/~warmerdam</a><br>and watch the world go round - Rush &nbsp;&nbsp;&nbsp;| Geospatial Programmer for Rent<br><br>_______________________________________________<br>gdal-dev mailing list<br><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>http://lists.osgeo.org/mailman/listinfo/gdal-dev<br></div></blockquote></div><br></body></html>