24.02.1
|
#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 | VLOAD_AND_CONVERT_TO_ACC_DATA_TYPE(n, offset, ptr) vload##n(offset, ptr) |
Functions | |
ACC_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_nchw_indices (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_stride_z, uint src_step_z, 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_stride_z, uint dst_step_z, uint dst_offset_first_element_in_bytes, __global uchar *indices_ptr, uint indices_stride_x, uint indices_step_x, uint indices_stride_y, uint indices_step_y, uint indices_stride_z, uint indices_step_z, uint indices_offset_first_element_in_bytes) |
Performs a MAX pooling of pool size equal to 2, and record max value indices for NCHW. More... | |
#define DIV_OP | ( | x, | |
y | |||
) | (x * (1.f / y)) |
Definition at line 42 of file pooling_layer.cl.
#define POOL_OP | ( | x, | |
y | |||
) | ((x) + (y)) |
Definition at line 27 of file pooling_layer.cl.
#define POW2_OP | ( | x, | |
vec_size | |||
) | (x) |
Definition at line 39 of file pooling_layer.cl.
#define SQRT_OP | ( | x | ) | sqrt((x)) |
Definition at line 43 of file pooling_layer.cl.
Definition at line 49 of file pooling_layer.cl.
ACC_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 52 of file pooling_layer.cl.
__kernel void pooling_layer_2_nchw_indices | ( | __global uchar * | src_ptr, |
uint | src_stride_x, | ||
uint | src_step_x, | ||
uint | src_stride_y, | ||
uint | src_step_y, | ||
uint | src_stride_z, | ||
uint | src_step_z, | ||
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_stride_z, | ||
uint | dst_step_z, | ||
uint | dst_offset_first_element_in_bytes, | ||
__global uchar * | indices_ptr, | ||
uint | indices_stride_x, | ||
uint | indices_step_x, | ||
uint | indices_stride_y, | ||
uint | indices_step_y, | ||
uint | indices_stride_z, | ||
uint | indices_step_z, | ||
uint | indices_offset_first_element_in_bytes | ||
) |
Performs a MAX pooling of pool size equal to 2, and record max value indices for NCHW.
[in] | src_ptr | Pointer to the source tensor. Supported data types: F16/F32 |
[in] | src_stride_x | Stride of the source tensor in X dimension (in bytes) |
[in] | src_step_x | src_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | src_stride_y | Stride of the source tensor in Y dimension (in bytes) |
[in] | src_step_y | src_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | src_stride_z | Stride of the source tensor in Z dimension (in bytes) |
[in] | src_step_z | src_stride_z * number of elements along Z processed per workitem(in bytes) |
[in] | src_offset_first_element_in_bytes | The offset of the first element in the source tensor |
[out] | dst_ptr | Pointer to the destination tensor. Supported data types: same as src_ptr |
[in] | dst_stride_x | Stride of the destination tensor in X dimension (in bytes) |
[in] | dst_step_x | dst_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | dst_stride_y | Stride of the destination tensor in Y dimension (in bytes) |
[in] | dst_step_y | dst_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | dst_stride_z | Stride of the source tensor in Z dimension (in bytes) |
[in] | dst_step_z | dst_stride_z * number of elements along Z processed per workitem(in bytes) |
[in] | dst_offset_first_element_in_bytes | The offset of the first element in the destination tensor |
[in] | indices_ptr | Pointer to the indices tensor. Supported data types: U32 |
[in] | indices_stride_x | Stride of the indices tensor in X dimension (in bytes) |
[in] | indices_step_x | indices_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | indices_stride_y | Stride of the indices tensor in Y dimension (in bytes) |
[in] | indices_step_y | indices_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | indices_stride_z | Stride of the indices tensor in Z dimension (in bytes) |
[in] | indices_step_z | indices_stride_z * number of elements along Z processed per workitem(in bytes) |
[in] | indices_offset_first_element_in_bytes | The offset of the first element in the indices tensor |
Definition at line 246 of file pooling_layer.cl.
References arm_compute::utility::clamp(), POOL_OP, arm_compute::test::validation::reference::select(), VEC_DATA_TYPE, VEC_OFFS, and VLOAD.