Compute Library
18.05
|
#include "helpers.h"
Go to the source code of this file.
Macros | |
#define | POOL_OP(x, y) ((x) + (y)) |
#define | POW2_OP(x, vec_size) (x) |
#define | DIV_OP(x, y) (x * (1.f / y)) |
#define | SQRT_OP(x) sqrt((x)) |
#define | DIV_OP_NHWC(x, y) (x * (VEC_DATA_TYPE(DATA_TYPE, 8))(1.f / y)) |
#define | POOLING3x3_STRIDE1(res, input, output) |
#define | POOLING3x3_STRIDE2(res, input, output) |
#define | POOLING3x3_STRIDE3(res, input, output) |
Functions | |
DATA_TYPE | calculate_avg_scale (const int pool_size_x, const int pool_size_y, const int upper_bound_w, const int upper_bound_h, const int pad_x, const int pad_y, const int stride_x, const int stride_y) |
__kernel void | pooling_layer_2 (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_stride_z, uint input_step_z, uint input_offset_first_element_in_bytes, __global uchar *output_ptr, uint output_stride_x, uint output_step_x, uint output_stride_y, uint output_step_y, uint output_stride_z, uint output_step_z, uint output_offset_first_element_in_bytes) |
Performs a pooling function of pool size equal to 2. More... | |
__kernel void | pooling_layer_3 (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_stride_z, uint input_step_z, uint input_offset_first_element_in_bytes, __global uchar *output_ptr, uint output_stride_x, uint output_step_x, uint output_stride_y, uint output_step_y, uint output_stride_z, uint output_step_z, uint output_offset_first_element_in_bytes) |
Performs a pooling function of pool size equal to 3. More... | |
DATA_TYPE | calculate_avg_scale_nhwc (const int pool_size_x, const int pool_size_y, int upper_bound_w, int upper_bound_h, const int pad_x, const int pad_y, const int stride_x, const int stride_y) |
__kernel void | pooling_layer_MxN_nhwc (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_stride_z, uint input_step_z, uint input_offset_first_element_in_bytes, __global uchar *output_ptr, uint output_stride_x, uint output_step_x, uint output_stride_y, uint output_step_y, uint output_stride_z, uint output_step_z, uint output_offset_first_element_in_bytes) |
Performs a pooling function of pool size equal to N (NHWC) More... | |
#define DIV_OP | ( | x, | |
y | |||
) | (x * (1.f / y)) |
Definition at line 60 of file pooling_layer.cl.
Referenced by pooling_layer_2(), and pooling_layer_3().
#define DIV_OP_NHWC | ( | x, | |
y | |||
) | (x * (VEC_DATA_TYPE(DATA_TYPE, 8))(1.f / y)) |
Definition at line 65 of file pooling_layer.cl.
Referenced by pooling_layer_MxN_nhwc().
#define POOL_OP | ( | x, | |
y | |||
) | ((x) + (y)) |
Definition at line 49 of file pooling_layer.cl.
Referenced by pooling_layer_2(), pooling_layer_3(), and pooling_layer_MxN_nhwc().
#define POOLING3x3_STRIDE1 | ( | res, | |
input, | |||
output | |||
) |
Definition at line 75 of file pooling_layer.cl.
#define POOLING3x3_STRIDE2 | ( | res, | |
input, | |||
output | |||
) |
Definition at line 118 of file pooling_layer.cl.
#define POOLING3x3_STRIDE3 | ( | res, | |
input, | |||
output | |||
) |
Definition at line 158 of file pooling_layer.cl.
#define POW2_OP | ( | x, | |
vec_size | |||
) | (x) |
Definition at line 57 of file pooling_layer.cl.
Referenced by pooling_layer_2(), and pooling_layer_3().
#define SQRT_OP | ( | x | ) | sqrt((x)) |
Definition at line 61 of file pooling_layer.cl.
Referenced by pooling_layer_2(), pooling_layer_3(), and pooling_layer_MxN_nhwc().
DATA_TYPE calculate_avg_scale | ( | const int | pool_size_x, |
const int | pool_size_y, | ||
const int | upper_bound_w, | ||
const int | upper_bound_h, | ||
const int | pad_x, | ||
const int | pad_y, | ||
const int | stride_x, | ||
const int | stride_y | ||
) |
Definition at line 188 of file pooling_layer.cl.
References arm_compute::test::fixed_point_arithmetic::detail::max(), and arm_compute::test::fixed_point_arithmetic::detail::min().
Referenced by pooling_layer_2(), and pooling_layer_3().
DATA_TYPE calculate_avg_scale_nhwc | ( | const int | pool_size_x, |
const int | pool_size_y, | ||
int | upper_bound_w, | ||
int | upper_bound_h, | ||
const int | pad_x, | ||
const int | pad_y, | ||
const int | stride_x, | ||
const int | stride_y | ||
) |
Definition at line 518 of file pooling_layer.cl.
References arm_compute::test::fixed_point_arithmetic::detail::max(), and arm_compute::test::fixed_point_arithmetic::detail::min().
Referenced by pooling_layer_MxN_nhwc().
__kernel void pooling_layer_2 | ( | __global uchar * | input_ptr, |
uint | input_stride_x, | ||
uint | input_step_x, | ||
uint | input_stride_y, | ||
uint | input_step_y, | ||
uint | input_stride_z, | ||
uint | input_step_z, | ||
uint | input_offset_first_element_in_bytes, | ||
__global uchar * | output_ptr, | ||
uint | output_stride_x, | ||
uint | output_step_x, | ||
uint | output_stride_y, | ||
uint | output_step_y, | ||
uint | output_stride_z, | ||
uint | output_step_z, | ||
uint | output_offset_first_element_in_bytes | ||
) |
Performs a pooling function of pool size equal to 2.
[in] | input_ptr | Pointer to the source image. Supported data types: QS8/QS16/F16/F32 |
[in] | input_stride_x | Stride of the source image in X dimension (in bytes) |
[in] | input_step_x | input_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | input_stride_y | Stride of the source image in Y dimension (in bytes) |
[in] | input_step_y | input_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | input_stride_z | Stride of the source tensor in Z dimension (in bytes) |
[in] | input_step_z | input_stride_z * number of elements along Z processed per workitem(in bytes) |
[in] | input_offset_first_element_in_bytes | The offset of the first element in the source image |
[out] | output_ptr | Pointer to the destination image. Supported data types: same as input_ptr |
[in] | output_stride_x | Stride of the destination image in X dimension (in bytes) |
[in] | output_step_x | output_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | output_stride_y | Stride of the destination image in Y dimension (in bytes) |
[in] | output_step_y | output_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | output_stride_z | Stride of the source tensor in Z dimension (in bytes) |
[in] | output_step_z | output_stride_z * number of elements along Z processed per workitem(in bytes) |
[in] | output_offset_first_element_in_bytes | The offset of the first element in the destination image |
Definition at line 228 of file pooling_layer.cl.
References calculate_avg_scale(), CONVERT_TO_TENSOR3D_STRUCT, DATA_TYPE, DIV_OP, POOL_OP, POW2_OP, Tensor3D::ptr, SQRT_OP, tensor3D_offset(), and VEC_DATA_TYPE.
__kernel void pooling_layer_3 | ( | __global uchar * | input_ptr, |
uint | input_stride_x, | ||
uint | input_step_x, | ||
uint | input_stride_y, | ||
uint | input_step_y, | ||
uint | input_stride_z, | ||
uint | input_step_z, | ||
uint | input_offset_first_element_in_bytes, | ||
__global uchar * | output_ptr, | ||
uint | output_stride_x, | ||
uint | output_step_x, | ||
uint | output_stride_y, | ||
uint | output_step_y, | ||
uint | output_stride_z, | ||
uint | output_step_z, | ||
uint | output_offset_first_element_in_bytes | ||
) |
Performs a pooling function of pool size equal to 3.
[in] | input_ptr | Pointer to the source image. Supported data types: QS8/QS16/F16/F32 |
[in] | input_stride_x | Stride of the source image in X dimension (in bytes) |
[in] | input_step_x | input_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | input_stride_y | Stride of the source image in Y dimension (in bytes) |
[in] | input_step_y | input_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | input_stride_z | Stride of the source tensor in Z dimension (in bytes) |
[in] | input_step_z | input_stride_z * number of elements along Z processed per workitem(in bytes) |
[in] | input_offset_first_element_in_bytes | The offset of the first element in the source image |
[out] | output_ptr | Pointer to the destination image. Supported data types: same as input_ptr |
[in] | output_stride_x | Stride of the destination image in X dimension (in bytes) |
[in] | output_step_x | output_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | output_stride_y | Stride of the destination image in Y dimension (in bytes) |
[in] | output_step_y | output_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | output_stride_z | Stride of the source tensor in Z dimension (in bytes) |
[in] | output_step_z | output_stride_z * number of elements along Z processed per workitem(in bytes) |
[in] | output_offset_first_element_in_bytes | The offset of the first element in the destination image |
Definition at line 292 of file pooling_layer.cl.
References calculate_avg_scale(), CONVERT_TO_TENSOR3D_STRUCT, DATA_TYPE, DIV_OP, POOL_OP, POW2_OP, Tensor3D::ptr, SQRT_OP, tensor3D_offset(), and VEC_DATA_TYPE.
__kernel void pooling_layer_MxN_nhwc | ( | __global uchar * | input_ptr, |
uint | input_stride_x, | ||
uint | input_step_x, | ||
uint | input_stride_y, | ||
uint | input_step_y, | ||
uint | input_stride_z, | ||
uint | input_step_z, | ||
uint | input_offset_first_element_in_bytes, | ||
__global uchar * | output_ptr, | ||
uint | output_stride_x, | ||
uint | output_step_x, | ||
uint | output_stride_y, | ||
uint | output_step_y, | ||
uint | output_stride_z, | ||
uint | output_step_z, | ||
uint | output_offset_first_element_in_bytes | ||
) |
Performs a pooling function of pool size equal to N (NHWC)
[in] | input_ptr | Pointer to the source image. Supported data types: F16/F32 |
[in] | input_stride_x | Stride of the source image in X dimension (in bytes) |
[in] | input_step_x | input_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | input_stride_y | Stride of the source image in Y dimension (in bytes) |
[in] | input_step_y | input_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | input_stride_z | Stride of the source tensor in Z dimension (in bytes) |
[in] | input_step_z | input_stride_z * number of elements along Z processed per workitem(in bytes) |
[in] | input_offset_first_element_in_bytes | The offset of the first element in the source image |
[out] | output_ptr | Pointer to the destination image. Supported data types: same as input_ptr |
[in] | output_stride_x | Stride of the destination image in X dimension (in bytes) |
[in] | output_step_x | output_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | output_stride_y | Stride of the destination image in Y dimension (in bytes) |
[in] | output_step_y | output_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | output_stride_z | Stride of the source tensor in Z dimension (in bytes) |
[in] | output_step_z | output_stride_z * number of elements along Z processed per workitem(in bytes) |
[in] | output_offset_first_element_in_bytes | The offset of the first element in the destination image |
Definition at line 565 of file pooling_layer.cl.
References calculate_avg_scale_nhwc(), CONVERT_TO_TENSOR3D_STRUCT, DIV_OP_NHWC, POOL_OP, Tensor3D::ptr, SQRT_OP, tensor3D_offset(), and VEC_DATA_TYPE.