Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / C / border.h
1 // Copyright (c) 2018 Intel Corporation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 ///////////////////////////////////////////////////////////////////////////////////////////////////
16 #ifndef BORDER_H
17 #define BORDER_H
18
19 #include "cldnn.h"
20
21
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 Type of border that will be added to the input by current layer / primitive
34 ///        ( @CLDNN_PRIMITIVE_DESC{border} ​).
35 typedef enum /*:int32_t*/
36 {
37     /// @brief All points in the border are set to constant value.
38     cldnn_border_constant,
39     cldnn_border_zero = cldnn_border_constant, /// keep bwd compatibilty 
40     /// @brief Border is constructed as an mirror of image (edge is also mirrored).
41     /// @details Size of border in any dimension cannot be larger than size of
42     ///          input in the same dimension.
43     cldnn_border_mirror,
44     /// @brief Border is constructed as an mirror of image (edge is NOT mirrored).
45     /// @details Size of border in any dimension cannot be larger than size of
46     ///          input in the same dimension decreased by @c 1.
47     cldnn_border_mirror_101,
48     /// @brief Border is constructed as an replication of edge.
49     /// @details Size of border in any dimension cannot be larger than size of
50     ///          input in the same dimension.
51     cldnn_border_edge
52 } cldnn_border_type;
53
54
55 /// @brief Adds border around input.
56 ///
57 /// @details Applies border of specified type around input data. The size of output data is increased
58 ///          by @c left_top_sizes and by @right_bottom_sizes.
59 /// @n
60 /// @n@b Requirements:
61 /// @n - @c left_top_sizes and @c right_bottom_sizes must be non-negative on all dimensions and compatible
62 ///      with size of input (describe the same dimensions).
63 /// @n - For @c border_type equal to @c cldnn_border_mirror, @c left_top_sizes and @c right_bottom_sizes
64 ///      must be lower than or equal to size of input on corresponding dimension (for all dimensions)
65 /// @n - For @c border_type equal to @c cldnn_border_mirror_101, @c left_top_sizes and @c right_bottom_sizes
66 ///      must be lower than size of input on corresponding dimension (for all dimensions)
67 CLDNN_BEGIN_PRIMITIVE_DESC(border)
68 /// @brief Size of border that needs to be added from left (in X dimension) and from top (in Y dimension).
69 cldnn_tensor left_top_sizes;
70 /// @brief Size of border that needs to be added from right (in X dimension) and from bottom (in Y dimension).
71 cldnn_tensor right_bottom_sizes;
72 /// @brief Type of border that needs to be added to the input.
73 cldnn_border_type border_type;
74 /// @brief Border value that is used in constant mode.
75 float border_value;
76 CLDNN_END_PRIMITIVE_DESC(border)
77
78
79 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(border);
80
81 #ifdef __cplusplus
82 }
83 #endif
84
85 /// @}
86 /// @}
87 /// @}
88 #endif // BORDER_H