SYCL Image processing

How do I go forward with Image processing with SYCL ?
I saw there was computeCpp but no longer maintained.
Is opencv + SYCL recommended where reading is done with opencv and for example gaussian kernel is then written using SYCL ?
What is recommended to get best performance ?

Hi @deutscher,
we don’t have any recommendation for a specific library to read images from files, I think OpenCV should be as good as any for this purpose. Once you have an image loaded into the host memory as a contiguous array, it can be used in SYCL like any other data. You can see an example of a gaussian blur implementation in our SYCL Academy learning material, in lessons 15-19 (check the slides and the solution source code):

https://github.com/codeplaysoftware/syclacademy/tree/main?tab=readme-ov-file#lesson-curriculum

The example uses STB to read the image into memory, and then just basic SYCL to process the data and implement the blur in lesson 15. Lessons 16-19 show some optimisation possibilities to improve the performance of this kernel.

This being said, we do offer interfaces which make dealing with image data in SYCL much easier, especially when more complex processing, access patterns and formatting of the image data are involved. While SYCL 2020 does already offer an image API:

https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:images

it has some flaws and limitations from its historical origin. If you’re using the DPC++ compiler, we would encourage you to have a look at the SYCL Bindless Images extension we have developed:

https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_bindless_images.asciidoc

There are several examples provided at the end of this documentation page.

Please let us know if you have any further questions.

1 Like