71 short16 l_data = convert_short16(vload16(0,
offset(&src, -1, 0)));
72 short16 r_data = convert_short16(vload16(0,
offset(&src, 1, 0)));
73 vstore16(r_data - l_data, 0, ((__global
short *)dst_gx.
ptr));
76 short16 t_data = convert_short16(vload16(0,
offset(&src, 0, -1)));
77 short16 b_data = convert_short16(vload16(0,
offset(&src, 0, 1)));
78 vstore16(b_data - t_data, 0, ((__global
short *)dst_gy.
ptr));
__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.
__global uchar * ptr
Pointer to the starting postion of the buffer.
__kernel void derivative(__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, __global uchar *dst_gx_ptr, uint dst_gx_stride_x, uint dst_gx_step_x, uint dst_gx_stride_y, uint dst_gx_step_y, uint dst_gx_offset_first_element_in_bytes, __global uchar *dst_gy_ptr, uint dst_gy_stride_x, uint dst_gy_step_x, uint dst_gy_stride_y, uint dst_gy_step_y, uint dst_gy_offset_first_element_in_bytes)
This OpenCL kernel that computes the first-order derivative.