add banchmark image alignment 2

This commit is contained in:
gfuse
2021-08-23 15:35:30 +02:00
parent 8df5e42a5b
commit 90e452f0c9
34 changed files with 3294 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
__kernel void integral_image(
__read_only image2d_t int_img, // grayescale image - height X width
__write_only image2d_t out_img // (height+1) X (width+1) with zero values
)
{
sampler_t const sampler = CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
int2 coord = (int2)(get_global_id(0)+1, get_global_id(1)+1);
int res = 0;
for (int i = 0; i < coord.x; i++)
for (int j = 0; j < coord.y; j++)
res += read_imageui(int_img, sampler, (int2)(i, j)); // bottom right corner
write_imageui(out_img, coord, res);
}