26 #pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable 45 __global ulong *global_sum
48 __global ulong *global_sum_sq
60 for(
int i = 0; i < height; i++)
63 uint8 data = convert_uint8(vload8(0,
offset(&src, 0, i)));
67 tmp_sum_sq += data * data;
71 tmp_sum.s0123 += tmp_sum.s4567;
72 tmp_sum.s01 += tmp_sum.s23;
73 atom_add(global_sum, tmp_sum.s0 + tmp_sum.s1);
76 tmp_sum_sq.s0123 += tmp_sum_sq.s4567;
77 tmp_sum_sq.s01 += tmp_sum_sq.s23;
78 atom_add(global_sum_sq, tmp_sum_sq.s0 + tmp_sum_sq.s1);
82 #pragma OPENCL EXTENSION cl_khr_int64_base_atomics : disable __global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
#define CONVERT_TO_IMAGE_STRUCT(name)
#define IMAGE_DECLARATION(name)
SimpleTensor< float > src
Structure to hold Image information.
__kernel void mean_stddev_accumulate(__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, uint height, __global ulong *global_sum, __global ulong *global_sum_sq)
This function calculates the sum and sum of squares of a given input image.