summaryrefslogtreecommitdiff
path: root/kernels
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@intel.com>2014-10-31 10:04:50 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-11-04 19:15:20 +0800
commit8cff1fda829bf886f07209bbb5a196039124028d (patch)
treebac2c4a3f88f7f3f585ff62c7217f5a25879acf5 /kernels
parent04a8b4e8a4e484f6c9346d5af969aed8606be774 (diff)
utest: change the box_blur_image to be identical to box_blur.
Change box_blur_image to read integer type surface thus it could be totally identical to the box_blur thus they can share the same reference image. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
Diffstat (limited to 'kernels')
-rw-r--r--kernels/compiler_box_blur_image.cl8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernels/compiler_box_blur_image.cl b/kernels/compiler_box_blur_image.cl
index 42f463b2..69fa2293 100644
--- a/kernels/compiler_box_blur_image.cl
+++ b/kernels/compiler_box_blur_image.cl
@@ -6,13 +6,15 @@ __kernel void compiler_box_blur_image(__read_only image2d_t src,
CLK_FILTER_NEAREST;
const int2 coord = (int2)(get_global_id(0), get_global_id(1));
int2 offset;
- float4 sum = 0;
+ uint4 sum = 0;
for (offset.y = -1; offset.y <= 1; offset.y++) {
for (offset.x = -1; offset.x <= 1; offset.x++) {
- sum += read_imagef(src, sampler, coord + offset);
+ sum += read_imageui(src, sampler, coord + offset);
}
}
- write_imagef(dst, coord, (1.0f/9.0f)*sum);
+ uint4 result = sum / 9;
+
+ write_imageui(dst, coord, result);
}