pyopencl icon indicating copy to clipboard operation
pyopencl copied to clipboard

Reduction algorithms on Image objects

Open eithun opened this issue 6 years ago • 4 comments

How can I perform a reduction on an Image object? The module (https://documen.tician.de/pyopencl/algorithm.html?highlight=reduction#pyopencl.reduction.ReductionKernel) seems to only support arrays being passed to kernel function.

eithun avatar Jun 14 '19 13:06 eithun

There's not currently code to do that, but I'd be happy to consider a patch if it's sufficiently clean. A particular problem is that images are often 2D.

inducer avatar Jun 14 '19 14:06 inducer

Yes, this functionally would be great! I'd like to do "image things" but also use the reduction algorithms, which only work for arrays.

eithun avatar Jun 14 '19 15:06 eithun

Is there any way I can accomplish this sort of task using the existing framework? For example, I've tried converting an image to an array by using the underlying buffer, but I haven't been successful.

eithun avatar Jun 14 '19 16:06 eithun

Yes, I can see not-too-invasive ways in which the current code could be generalized to that setting. In terms of "the underlying buffer" of an image, I'm not sure there is such a thing.

inducer avatar Jun 14 '19 17:06 inducer