diff options
author | Cathal Corbett <cathal.corbett@arm.com> | 2022-05-11 20:12:17 +0100 |
---|---|---|
committer | Cathal Corbett <cathal.corbett@arm.com> | 2022-05-12 13:41:56 +0100 |
commit | 4b19d2249e3b8f9216ec5b410fad20c41b4c6053 (patch) | |
tree | b7511932f11b2c27f39e1e76ac290ba3baca0fda /src/backends/backendsCommon/WorkloadUtils.cpp | |
parent | 50bc39e401532f9aa838e3d9b1f3e3ae5845e37f (diff) | |
download | armnn-4b19d2249e3b8f9216ec5b410fad20c41b4c6053.tar.gz |
IVGCVSW-6940 ConstTensorsAsInput: DepthwiseConvolution2d - Complete ACL
* Added backend specific optimization & test for CpuAcc and GpuAcc: PermuteDepthwiseConv2dWeights
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com>
Change-Id: I600476b2e9c557a39818a574c1091c9d650b21b1
Diffstat (limited to 'src/backends/backendsCommon/WorkloadUtils.cpp')
-rw-r--r-- | src/backends/backendsCommon/WorkloadUtils.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backends/backendsCommon/WorkloadUtils.cpp b/src/backends/backendsCommon/WorkloadUtils.cpp index d2ae16af0c..b045530abc 100644 --- a/src/backends/backendsCommon/WorkloadUtils.cpp +++ b/src/backends/backendsCommon/WorkloadUtils.cpp @@ -175,12 +175,14 @@ std::tuple<TensorInfo, unsigned int> Convert1HWOTensorInfoToAcl(const TensorInfo TensorInfo weightsPermuted; if (dataLayout == armnn::DataLayout::NHWC) { - // No permutation required. Data layouts are the same. + // No permutation required. Input and weights data layouts are the same. aclDepthMultiplier = weightInfo.GetShape()[3] / inputInfo.GetShape()[3]; weightsPermuted = weightInfo; } + else if (dataLayout == armnn::DataLayout::NCHW) { + // Weights permutation required. Weights [N,H,W,C] and input [N,C,H,W] data layouts are different. // [ 1, H, W, I*M] --> [ 1, I * M, H, W ] aclDepthMultiplier = weightInfo.GetShape()[3] / inputInfo.GetShape()[1]; PermutationVector permutationVector{ 0, 2, 3, 1 }; |