Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / C / pooling.h
1 /*
2 // Copyright (c) 2016-2018 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
18 #ifndef POOLING_H
19 #define POOLING_H
20
21 #include "cldnn.h"
22 /// @addtogroup c_api C API
23 /// @{
24 /// @addtogroup c_topology Network Topology
25 /// @{
26 /// @addtogroup c_primitives Primitives
27 /// @{
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /// @brief Select method for Pooling layer ( @CLDNN_PRIMITIVE_DESC{pooling} ).
34 typedef enum /*:int32_t*/
35 {
36     /// @brief Maximum-pooling method.
37     cldnn_pooling_max,
38     /// @brief Average-pooling method.
39     cldnn_pooling_average,
40     /// @brief Average-pooling method without values which are outside of the input.
41     cldnn_pooling_average_no_padding,
42     /// @brief Maximum-pooling method with additional buffer to store argmax indices.
43     cldnn_pooling_max_with_argmax,
44     /// @brief Pooling with bilinear interpolation
45     cldnn_pooling_bilinear
46 } cldnn_pooling_mode;
47
48 /// @brief Performs "pooling" operation which is a form of non-linear down-sampling.
49 /// @details Pools the input image by taking the max, average, etc. within regions.
50 CLDNN_BEGIN_PRIMITIVE_DESC(pooling)
51 /// @brief Primitive id which contains indices of each max pooling region. Indices must be in flattened bfyx format with no padding. Needs to be fp32 data type.
52 cldnn_primitive_id argmax;
53 /// @brief Pooling method. See #cldnn_pooling_mode.
54 int32_t mode;
55 /// @brief Global pooling (kernel size is equal to the spatial dimension of input tensor)
56 int8_t global_pooling;
57 /// @brief Defines a shift, relative to (0,0) position of the input buffer, where (0,0) point of the pooling window should start calculations.
58 cldnn_tensor input_offset;
59 /// @brief Defines shift in input buffer between adjacent calculations of output values.
60 cldnn_tensor stride;
61 /// @brief Pooling kernel size.
62 cldnn_tensor size;
63 /// @brief Indicates that the primitive has user-defined output size (non-zero value).
64 uint32_t with_output_size;
65 /// @brief User-defined output data size of the primitive (w/o padding).
66 cldnn_tensor output_size;
67 CLDNN_END_PRIMITIVE_DESC(pooling)
68
69 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(pooling);
70
71 #ifdef __cplusplus
72 }
73 #endif
74
75 /// @}
76 /// @}
77 /// @}
78 #endif /* POOLING_H */