OLD | NEW |
(Empty) | |
| 1 #pragma OPENCL_EXTENSION cl_khr_global_int32_base_atomics |
| 2 |
| 3 const sampler_t gInSampler = CLK_NORMALIZED_COORDS_FALSE | |
| 4 CLK_ADDRESS_CLAMP_TO_EDGE | |
| 5 CLK_FILTER_NEAREST; |
| 6 |
| 7 __kernel void diff(read_only image2d_t baseline, read_only image2d_t test, __glo
bal int* result) { |
| 8 int2 coord = (int2)(get_global_id(0), get_global_id(1)); |
| 9 uint4 baselinePixel = read_imageui(baseline, gInSampler, coord); |
| 10 uint4 testPixel = read_imageui(test, gInSampler, coord); |
| 11 int4 pixelCompare = baselinePixel == testPixel; |
| 12 if (baselinePixel.x != testPixel.x || |
| 13 baselinePixel.y != testPixel.y || |
| 14 baselinePixel.z != testPixel.z || |
| 15 baselinePixel.w != testPixel.w) { |
| 16 |
| 17 atom_inc(result); |
| 18 } |
| 19 } |
OLD | NEW |