aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Bentham <Matthew.Bentham@arm.com>2019-05-10 16:55:23 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-05-13 16:41:01 +0000
commit49cb7d0568b7d4c81889a1791a4ca4e6bd5c8f32 (patch)
tree5ca466f7452d14de6e2f7ef1c8666ccbbd897b6b
parentf0bd68386cc8598f702b1df2d1ba60094e6a9d97 (diff)
downloadarmnn-49cb7d0568b7d4c81889a1791a4ca4e6bd5c8f32.tar.gz
MLCE-101 Add dilation support to reference backend
Change-Id: I6d1ea80c9fabd8c50ee030272c51cb66e85e431d Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com>
-rw-r--r--src/backends/reference/test/RefLayerTests.cpp2
-rw-r--r--src/backends/reference/workloads/ConvImpl.hpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/backends/reference/test/RefLayerTests.cpp b/src/backends/reference/test/RefLayerTests.cpp
index b2600029b1..01afff8b02 100644
--- a/src/backends/reference/test/RefLayerTests.cpp
+++ b/src/backends/reference/test/RefLayerTests.cpp
@@ -81,6 +81,8 @@ ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dUint8Nhwc,
DepthwiseConvolution2dUint8Test,
false,
armnn::DataLayout::NHWC)
+ARMNN_AUTO_TEST_CASE(SimpleDepthwiseConvolution2d3x3Dilation3x3Nhwc,
+ SimpleDepthwiseConvolution2d3x3Dilation3x3NhwcTest)
ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dDepthMul1,
diff --git a/src/backends/reference/workloads/ConvImpl.hpp b/src/backends/reference/workloads/ConvImpl.hpp
index 5c07f57ec0..23b402aa77 100644
--- a/src/backends/reference/workloads/ConvImpl.hpp
+++ b/src/backends/reference/workloads/ConvImpl.hpp
@@ -97,6 +97,8 @@ static void ConvImpl(ConvData data,
unsigned int paddingLeft = data.m_Parameters.m_PadLeft;
unsigned int xStride = data.m_Parameters.m_StrideX;
unsigned int yStride = data.m_Parameters.m_StrideY;
+ unsigned int xDilation = data.m_Parameters.m_DilationX;
+ unsigned int yDilation = data.m_Parameters.m_DilationY;
// The world's least efficient convolution.
for (unsigned int batchIdx = 0; batchIdx < batchSize; batchIdx++)
@@ -158,8 +160,8 @@ static void ConvImpl(ConvData data,
AccumulatorType filterValue = filterData[filterIndex] -
boost::numeric_cast<AccumulatorType>(filterOffset);
- unsigned int yInput = yOutput * yStride + yFilter;
- unsigned int xInput = xOutput * xStride + xFilter;
+ unsigned int yInput = yOutput * yStride + yFilter * yDilation;
+ unsigned int xInput = xOutput * xStride + xFilter * xDilation;
AccumulatorType inputValue;