Compute Library  18.03
dilate.cl File Reference
#include "helpers.h"

Go to the source code of this file.

Functions

__kernel void dilate (__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_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes)
 This function dilates an input image. More...
 

Function Documentation

__kernel void dilate ( __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_ptr,
uint  dst_stride_x,
uint  dst_step_x,
uint  dst_stride_y,
uint  dst_step_y,
uint  dst_offset_first_element_in_bytes 
)

This function dilates an input image.

Parameters
[in]src_ptrPointer to the source image. Supported data types: U8
[in]src_stride_xStride of the source image in X dimension (in bytes)
[in]src_step_xsrc_stride_x * number of elements along X processed per workitem(in bytes)
[in]src_stride_yStride of the source image in Y dimension (in bytes)
[in]src_step_ysrc_stride_y * number of elements along Y processed per workitem(in bytes)
[in]src_offset_first_element_in_bytesThe offset of the first element in the source image
[out]dst_ptrPointer to the destination image. Supported data types: U8
[in]dst_stride_xStride of the destination image in X dimension (in bytes)
[in]dst_step_xdst_stride_x * number of elements along X processed per workitem(in bytes)
[in]dst_stride_yStride of the destination image in Y dimension (in bytes)
[in]dst_step_ydst_stride_y * number of elements along Y processed per workitem(in bytes)
[in]dst_offset_first_element_in_bytesThe offset of the first element in the destination image

Definition at line 41 of file dilate.cl.

References CONVERT_TO_IMAGE_STRUCT, arm_compute::test::validation::dst, arm_compute::test::fixed_point_arithmetic::detail::max(), offset(), Image::ptr, and arm_compute::test::validation::src.

Referenced by DilateValidationFixture< TensorType, AccessorType, FunctionType, T >::setup().

44 {
47 
48  uchar16 top = vload16(0, offset(&src, -1, -1));
49  uchar16 middle = vload16(0, offset(&src, -1, 0));
50  uchar16 bottom = vload16(0, offset(&src, -1, 1));
51 
52  uchar16 tmp = max(top, max(middle, bottom));
53  uchar8 out = max(tmp.s01234567, max(tmp.s12345678, tmp.s23456789));
54 
55  vstore8(out, 0, dst.ptr);
56 }
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
Definition: helpers.h:301
#define CONVERT_TO_IMAGE_STRUCT(name)
Definition: helpers.h:102
Structure to hold Image information.
Definition: helpers.h:140
__global uchar * ptr
Pointer to the starting postion of the buffer.
Definition: helpers.h:142
fixed_point< T > max(fixed_point< T > x, fixed_point< T > y)
Definition: FixedPoint.h:889
convolution configure & src