ARM Compute Library
17.04
|
#include "helpers.h"
Go to the source code of this file.
Macros | |
#define | POOL_OP(x, y) ((x) + (y)) |
Functions | |
float | calculate_avg_scale (const int pool_size, 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_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_offset_first_element_in_bytes, int2 max_dims, int2 strides, int2 paddings) |
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_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_offset_first_element_in_bytes, int2 max_dims, int2 strides, int2 paddings) |
Performs a pooling function of pool size equal to 3. More... | |
#define POOL_OP | ( | x, | |
y | |||
) | ((x) + (y)) |
Definition at line 27 of file pooling_layer.cl.
Referenced by pooling_layer_2(), and pooling_layer_3().
float calculate_avg_scale | ( | const int | pool_size, |
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 32 of file pooling_layer.cl.
Referenced by pooling_layer_2(), and pooling_layer_3().
__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_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_offset_first_element_in_bytes, | ||
int2 | max_dims, | ||
int2 | strides, | ||
int2 | paddings | ||
) |
Performs a pooling function of pool size equal to 2.
[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_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: F16, F32 |
[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_offset_first_element_in_bytes | The offset of the first element in the destination image |
[in] | max_dims | The maximum index that can be accessed in x and y dimension (width + pad) |
[in] | strides | The pooling operation strides in each dimension |
[in] | paddings | The pooling operation paddings in each dimension |
Definition at line 64 of file pooling_layer.cl.
References calculate_avg_scale(), CONVERT_TO_IMAGE_STRUCT, DATA_TYPE, offset(), POOL_OP, Image::ptr, 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_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_offset_first_element_in_bytes, | ||
int2 | max_dims, | ||
int2 | strides, | ||
int2 | paddings | ||
) |
Performs a pooling function of pool size equal to 3.
[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_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: F16, F32 |
[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_offset_first_element_in_bytes | The offset of the first element in the destination image |
[in] | max_dims | The maximum index that can be accessed in x and y dimension (width + pad) |
[in] | strides | The pooling operation strides in each dimension |
[in] | paddings | The pooling operation paddings in each dimension |
Definition at line 118 of file pooling_layer.cl.
References calculate_avg_scale(), CONVERT_TO_IMAGE_STRUCT, DATA_TYPE, offset(), POOL_OP, Image::ptr, and VEC_DATA_TYPE.