-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
When writing a OpenCL kernel in clEsperanto, the code for reading a pixel usually looks like this:
const POS_src_TYPE spos = POS_src_INSTANCE(sx, sy, 0, 0);
const float a = READ_src_IMAGE(src,sampler,spos).x;I understand the benefits that clEsperanto gives us here. But I would suggest to go further and simplify this by adding a C #define such that the example above could be rewritten as:
const float a = READ_PIXEL_2D(src, sx, sy);The define could look like this:
#define READ_PIXEL_2D(image, x, y) (READ_ ## image ## _IMAGE((image), sampler, POS_ ## image ## _INSTANCE((x), (y), 0, 0)).x)The same should be done for image writing, and 3d images.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels