diff options
Diffstat (limited to 'src/backends/backendsCommon/test')
-rw-r--r-- | src/backends/backendsCommon/test/Conv2dTestImpl.hpp | 1 | ||||
-rw-r--r-- | src/backends/backendsCommon/test/LayerTests.cpp | 18 | ||||
-rw-r--r-- | src/backends/backendsCommon/test/WorkloadTestUtils.hpp | 3 |
3 files changed, 13 insertions, 9 deletions
diff --git a/src/backends/backendsCommon/test/Conv2dTestImpl.hpp b/src/backends/backendsCommon/test/Conv2dTestImpl.hpp index bb5656bd01..0533c77d53 100644 --- a/src/backends/backendsCommon/test/Conv2dTestImpl.hpp +++ b/src/backends/backendsCommon/test/Conv2dTestImpl.hpp @@ -1125,6 +1125,7 @@ LayerTestResult<T,4> CompareConvolution2dTestImpl( ExecuteWorkload(*workload, memoryManager); + workloadRef->PostAllocationConfigure(); workloadRef->Execute(); CopyDataFromITensorHandle(&ret.output[0][0][0][0], outputHandle.get()); diff --git a/src/backends/backendsCommon/test/LayerTests.cpp b/src/backends/backendsCommon/test/LayerTests.cpp index 5d059598a5..c94dc53291 100644 --- a/src/backends/backendsCommon/test/LayerTests.cpp +++ b/src/backends/backendsCommon/test/LayerTests.cpp @@ -79,12 +79,12 @@ static std::vector<float> Bias2({0, 2}); // Helper function that returns either Bias2 or an empty vector depending on whether bias is enabled. template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> -boost::multi_array<T, 1> GetBias2(bool biasEnabled, float qScale, int32_t qOffset) +boost::multi_array<T, 1> GetBias2(bool biasEnabled, float qScale) { if(biasEnabled) { armnn::TensorInfo biasDesc({static_cast<unsigned int>(Bias2.size())}, ArmnnType); - boost::multi_array<T, 1> bias = MakeTensor<T, 1>(biasDesc, QuantizedVector<T>(qScale, qOffset, Bias2)); + boost::multi_array<T, 1> bias = MakeTensor<T, 1>(biasDesc, QuantizedVector<T>(qScale, 0.0f, Bias2)); return bias; } else @@ -170,7 +170,7 @@ LayerTestResult<T, 4> SimpleConvolution2d3x5TestCommon( memoryManager, input, kernel, - GetBias2<ArmnnBType>(biasEnabled, qScale, qOffset), + GetBias2<ArmnnBType>(biasEnabled, qScale * qScale), expectedOutput, qScale, qOffset, @@ -247,7 +247,7 @@ LayerTestResult<T, 4> SimpleConvolution2d3x3TestCommon( memoryManager, input, kernel, - GetBias2<ArmnnBType>(biasEnabled, qScale, qOffset), + GetBias2<ArmnnBType>(biasEnabled, qScale * qScale), expectedOutput, qScale, qOffset, @@ -494,7 +494,7 @@ LayerTestResult<T, 4> Convolution2dAsymmetricPaddingLargerThanHalfKernelSizeTest memoryManager, input, kernel, - GetBias2<ArmnnBType>(false, qScale, qOffset), + GetBias2<ArmnnBType>(false, qScale * qScale), expectedOutput, qScale, qOffset, @@ -552,7 +552,7 @@ LayerTestResult<T, 4> SimpleConvolution2dAsymmetricPaddingTestCommon( memoryManager, input, kernel, - GetBias2<ArmnnBType>(false, qScale, qOffset), + GetBias2<ArmnnBType>(false, qScale * qScale), expectedOutput, qScale, qOffset, @@ -627,7 +627,7 @@ LayerTestResult<T, 4> DepthwiseConvolution2dAsymmetricTestCommon( memoryManager, input, kernel, - GetBias2<ArmnnBType>(biasEnabled, qScale, qOffset), + GetBias2<ArmnnBType>(biasEnabled, qScale * qScale), expectedOutput, qScale, qOffset, @@ -736,7 +736,7 @@ LayerTestResult<T, 4> DepthwiseConvolution2dNhwcTestCommon( memoryManager, input, kernel, - GetBias2<ArmnnBType>(biasEnabled, qScale, qOffset), + GetBias2<ArmnnBType>(biasEnabled, qScale * qScale), expectedOutput, qScale, qOffset, @@ -802,7 +802,7 @@ LayerTestResult<T, 4> SimpleDepthwiseConvolution2d3x3Dilation3x3NhwcTestCommon( memoryManager, input, kernel, - GetBias2<ArmnnBType>(biasEnabled, qScale, qOffset), + GetBias2<ArmnnBType>(biasEnabled, qScale * qScale), expectedOutput, qScale, qOffset, diff --git a/src/backends/backendsCommon/test/WorkloadTestUtils.hpp b/src/backends/backendsCommon/test/WorkloadTestUtils.hpp index d03c5a9210..212fea34a6 100644 --- a/src/backends/backendsCommon/test/WorkloadTestUtils.hpp +++ b/src/backends/backendsCommon/test/WorkloadTestUtils.hpp @@ -73,6 +73,9 @@ inline void ExecuteWorkload(armnn::IWorkload& workload, memoryManager->Acquire(); } + // Perform PostAllocationConfiguration + workload.PostAllocationConfigure(); + // Execute the workload workload.Execute(); |