Publishing R3
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / C / pooling.h
1 /*
2 // Copyright (c) 2016 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 } cldnn_pooling_mode;
45
46 /// @brief Performs "pooling" operation which is a form of non-linear down-sampling.
47 /// @details Pools the input image by taking the max, average, etc. within regions.
48 CLDNN_BEGIN_PRIMITIVE_DESC(pooling)
49 /// @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.
50 cldnn_primitive_id argmax;
51 /// @brief Pooling method. See #cldnn_pooling_mode.
52 int32_t mode;
53 /// @brief Defines a shift, relative to (0,0) position of the input buffer, where (0,0) point of the pooling window should start calculations.
54 cldnn_tensor input_offset;
55 /// @brief Defines shift in input buffer between adjacent calculations of output values.
56 cldnn_tensor stride;
57 /// @brief Pooling kernel size.
58 cldnn_tensor size;
59 /// @brief Indicates that the primitive has user-defined output size (non-zero value).
60 uint32_t with_output_size;
61 /// @brief User-defined output data size of the primitive (w/o padding).
62 cldnn_tensor output_size;
63 CLDNN_END_PRIMITIVE_DESC(pooling)
64
65 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(pooling);
66
67 #ifdef __cplusplus
68 }
69 #endif
70
71 /// @}
72 /// @}
73 /// @}
74 #endif /* POOLING_H */
75