[SoC] Week 5 OpenCL Integration

Seth Price seth at pricepages.org
Mon Jun 21 21:56:28 EDT 2010


1) What did I do last week.

I spent the first half of the week working on finishing all the  
support code in r.sun. Now the only thing left to do is remove that  
pj_do_proj() call I've previously mentioned. I think it should be easy  
to use latin and longin data (when available) to replace the call,  
which would solve my problem because I can easily pre-compute that.

Since then I've been working on the warper. I'm done with the init  
code, and next I think I'll work on the kernel so I have a better  
understanding of how the memory structure will work.

2) What I plan to do this week.

I'll be working on the rest of the code for the warper API. I should  
be running and testing code by the end of the week.

3) Do I have any problems or obstacles which interfere with my work?

The memory structure and accessing will be interesting. I'll be  
working with images in OpenCL, and most (all?) raster resampling  
modules in GRASS operate on one channel at a time. However, the image  
functions read four float vectors, so I'll be wasting 3/4 of my  
register space and possible computation there. GDAL users will have  
the best opportunity for speedup because they can apply calculations  
to all the bands with one function call. Often in practice, however,  
only one band is computed at a time. So the OpenCL usage in practice  
in GDAL and GRASS may be a bit of a waste. :(

I may change my method of computation, or I might alter the GRASS  
modules to accept up to four inputs at a time. The fastest method (and  
best use of resources) will be calculating four bands at a time, but  
it feels like a bit of a hack because it requires the extra bands from  
the user. Another method will be calculating all the weights for  
resampling, then applying them to each band. This will be more  
efficient on single band images, but the calculations will be more  
difficult, and I don't think the GPU has enough storage space to store  
large kernels between calculations. (I don't know if it's even a good  
idea to try.)

I don't feel like I was very clear with my problems, so if you have  
questions, please email me.
~Seth


More information about the SoC mailing list