Re: [Gegl-developer] OpenCL support



Hi Adel,

GEGL is a tiled engine and there's reasons for that, such as being able to manipulate large images that would use too much memory otherwise. Because of that, tiles are not contiguous in memory so there's no way of accessing this data without an extra copy.

For that, you would use:

- gegl_buffer_get (http://www.gegl.org/api.html#gegl_buffer_get) to copy the geglbuffer image data to a contiguous memory chunk of yours
- do your processing
- gegl_buffer_set to update the buffer with the new data

Because that is an expensive copying operation we prefer that filters use the iterator unless global access to the image data is required in the filter.

If you give a look at motion-blur-zoom.c, it does something like that (though it doesn't use CL).

Hope that clears it up, let me know if you have any more questions.
Victor

On Tue, Oct 13, 2015 at 10:14 AM, Adel Johar <adeljo hotmail com> wrote:

Hi Victor,

 

I’m currently trying to help Vincent out with the development of the tutorial, though I’ve hit a bit of a snag. Based on what I’ve seen from an old blog post of yours (and from code snippets from the current source codes), I understand that an iterator is used to iterate through the GEGL buffer to extract tiles and to run the OpenCL kernel on each tile. Do correct me if I’m wrong, but at this point it seems that an OpenCL kernel is called to operate on one tile at a time as the iterator moves the buffer from one tile to another.

 

As part of the tutorial, rather than integrating the kernels directly into the GEGL library, I believe it would be more beneficial if those who partake in the tutorial to write their own host code as well. I was hoping to inquire on a more detailed explanation on how the image data can be extracted from the GEGL Buffer as a whole rather than as tiles through an iterator; whereby participants can then look at improving the tiling process and see how such improvements can be integrated into the GEGL library. While it would certainly be easier to integrate the kernels directly into the GEGL library, as a starting step it would be good if the users of the tutorial can learn both the kernel and host side of OpenCL.

 

Thank you,

And Best Regards,

Adel

 

 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]