26 #pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable 27 #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics : enable 46 __global ulong *global_sum
49 __global ulong *global_sum_sq
61 for(
int i = 0; i < height; i++)
64 uint8 data = convert_uint8(vload8(0,
offset(&src, 0, i)));
68 tmp_sum_sq += data * data;
72 tmp_sum.s0123 += tmp_sum.s4567;
73 tmp_sum.s01 += tmp_sum.s23;
74 atom_add(global_sum, tmp_sum.s0 + tmp_sum.s1);
77 tmp_sum_sq.s0123 += tmp_sum_sq.s4567;
78 tmp_sum_sq.s01 += tmp_sum_sq.s23;
79 atom_add(global_sum_sq, tmp_sum_sq.s0 + tmp_sum_sq.s1);
83 #pragma OPENCL EXTENSION cl_khr_int64_base_atomics : disable 84 #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics : disable #define IMAGE_DECLARATION(name)
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
#define CONVERT_TO_IMAGE_STRUCT(name)
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.
convolution configure & src