aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/Types.h
diff options
context:
space:
mode:
authorJaroslaw Rzepecki <jaroslaw.rzepecki@arm.com>2017-10-13 11:13:58 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commita1ed41fe2427dfa2b5d0139444ceb77ad16a5a73 (patch)
treea57bc2369afea73c190d9bb595b0a229bf8da749 /arm_compute/core/Types.h
parentb4276c5b76f6eda22d973bfa48ff9612e7f183e5 (diff)
downloadComputeLibrary-a1ed41fe2427dfa2b5d0139444ceb77ad16a5a73.tar.gz
IVGCVSW-601: support for asymetric padding in cl conv and depthwise conv
Change-Id: I5c6c95091ae77dba96459c0640f9f6167a988c8c Reviewed-on: http://mpd-gerrit.cambridge.arm.com/91700 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'arm_compute/core/Types.h')
-rw-r--r--arm_compute/core/Types.h60
1 files changed, 57 insertions, 3 deletions
diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h
index f9766b39be..f52dd12597 100644
--- a/arm_compute/core/Types.h
+++ b/arm_compute/core/Types.h
@@ -418,7 +418,32 @@ public:
unsigned int pad_x = 0, unsigned int pad_y = 0,
DimensionRoundingType round = DimensionRoundingType::FLOOR)
: _stride(std::make_pair(stride_x, stride_y)),
- _pad(std::make_pair(pad_x, pad_y)),
+ _pad_left(pad_x),
+ _pad_top(pad_y),
+ _pad_right(pad_x),
+ _pad_bottom(pad_y),
+ _round_type(round)
+ {
+ }
+ /** Constructor
+ *
+ * @param[in] stride_x Stride, in elements, across x.
+ * @param[in] stride_y Stride, in elements, across y.
+ * @param[in] pad_left Padding across x on the left, in elements.
+ * @param[in] pad_top Padding across y on the top, in elements.
+ * @param[in] pad_right Padding across x on the right, in elements.
+ * @param[in] pad_bottom Padding across y on the bottom, in elements.
+ * @param[in] round Dimensions rounding.
+ */
+ PadStrideInfo(unsigned int stride_x, unsigned int stride_y,
+ unsigned int pad_left, unsigned int pad_right,
+ unsigned int pad_top, unsigned int pad_bottom,
+ DimensionRoundingType round)
+ : _stride(std::make_pair(stride_x, stride_y)),
+ _pad_left(pad_left),
+ _pad_top(pad_top),
+ _pad_right(pad_right),
+ _pad_bottom(pad_bottom),
_round_type(round)
{
}
@@ -428,16 +453,45 @@ public:
}
std::pair<unsigned int, unsigned int> pad() const
{
- return _pad;
+ //this accessor should be used only when padding is symmetric
+ ARM_COMPUTE_ERROR_ON(_pad_left != _pad_right || _pad_top != _pad_bottom);
+ return std::make_pair(_pad_left, _pad_top);
}
+
+ unsigned int pad_left() const
+ {
+ return _pad_left;
+ }
+ unsigned int pad_right() const
+ {
+ return _pad_right;
+ }
+ unsigned int pad_top() const
+ {
+ return _pad_top;
+ }
+ unsigned int pad_bottom() const
+ {
+ return _pad_bottom;
+ }
+
DimensionRoundingType round() const
{
return _round_type;
}
+ bool has_padding() const
+ {
+ return (_pad_left != 0 || _pad_top != 0 || _pad_right != 0 || _pad_bottom != 0);
+ }
+
private:
std::pair<unsigned int, unsigned int> _stride;
- std::pair<unsigned int, unsigned int> _pad;
+ unsigned int _pad_left;
+ unsigned int _pad_top;
+ unsigned int _pad_right;
+ unsigned int _pad_bottom;
+
DimensionRoundingType _round_type;
};