clEsperanto / CLIc

GPU-accelerated Image Processing library
https://clesperanto.github.io/CLIc/
BSD 3-Clause "New" or "Revised" License
14 stars 15 forks source link

GPU support image format but it return `0` or `CL_IMAGE_FORMAT_NOT_SUPPORTED` #317

Closed StRigaud closed 4 months ago

StRigaud commented 4 months ago

in OpenCL, the cl_image is defined by a cl_image_format composed of cl_channel_order and cl_channel_type.

Clesperanto only manage single channel image, which point to the following channel_order: CL_R, CL_A, CL_INTENSITY, or CL_LUMINANCE.

Eventhough they all represente a single channel image, their behaviour differe based on opencl version and hardware. Quick tests shows the following.

On my local NVIDIA card:

This point toward the usage of the CL_R. I will set a PR to ensure maximum compatibility.

Classic OpenCL error that could be related to this issue is CL_IMAGE_FORMAT_NOT_SUPPORTED

StRigaud commented 4 months ago

@haesleinhuepf

With #318, cl_image is fully compatible on my M2, this include the interpolation. This will be available on the python side with the next release (soon).

haesleinhuepf commented 4 months ago

That's super cool! And it might be an advantage over clij2 and pyclesperanto_prototype

StRigaud commented 4 months ago

Its possible that it is the same issue for the prototype and clij2 somewhere in the code?

Rigth now I am trying to make the CI skip tests over images because it does not support them. Once I manage, I will merge and make a release to have both chan-vese and affine transform operational

StRigaud commented 4 months ago

Test involving images are always skip. To enable them for local test, one must comment GTEST_SKIP() in the test code.

Its not great but will do for now