diff options
author | Teresa Charlin <teresa.charlinreyes@arm.com> | 2020-05-22 18:08:23 +0100 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2020-05-25 18:07:41 +0000 |
commit | ecb6b8e2ef33daf7b5cd6b61cdea5c6339cf9c51 (patch) | |
tree | cf456bdb85d5097c3fef7b4f5b59edfca360450d /src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp | |
parent | e300b36606871089d6fec4334a2b5493c7303a94 (diff) | |
download | armnn-ecb6b8e2ef33daf7b5cd6b61cdea5c6339cf9c51.tar.gz |
IVGCVSW-4863 ADD,SUB,DIV,MUL,MAXIMUM and MINIMUM int32 VTS test
skipped in CpuRef
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: I1c870ac258e8c3805a95b259cb40731f8e81541e
Diffstat (limited to 'src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp')
-rw-r--r-- | src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp index 1a9cf5b173..18f4831881 100644 --- a/src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp +++ b/src/backends/backendsCommon/test/layerTests/MultiplicationTestImpl.cpp @@ -396,6 +396,105 @@ LayerTestResult<int16_t, 4> MultiplicationBroadcast1DVectorInt16Test( output); } +LayerTestResult<int32_t, 4> MultiplicationInt32Test( + armnn::IWorkloadFactory& workloadFactory, + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) +{ + const unsigned int shape[] = { 1, 2, 2, 3 }; + + std::vector<int32_t> input0 = + { + 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17 + }; + + std::vector<int32_t> input1 = + { + 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12 + }; + + std::vector<int32_t> output = + { + 6, 14, 24, 36, 50, 66, + 84, 104, 126, 150, 176, 204 + }; + + return ElementwiseTestHelper<4, armnn::MultiplicationQueueDescriptor, armnn::DataType::Signed32>( + workloadFactory, + memoryManager, + shape, + input0, + shape, + input1, + shape, + output); +} + +LayerTestResult<int32_t, 4> MultiplicationBroadcast1ElementInt32Test( + armnn::IWorkloadFactory& workloadFactory, + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) +{ + const unsigned int shape0[] = { 1, 2, 2, 3 }; + const unsigned int shape1[] = { 1, 1, 1, 1 }; + + std::vector<int32_t> input0 = + { + 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12 + }; + + std::vector<int32_t> input1 = { 2 }; + + std::vector<int32_t> output = + { + 2, 4, 6, 8, 10, 12, + 14, 16, 18, 20, 22, 24 + }; + + return ElementwiseTestHelper<4, armnn::MultiplicationQueueDescriptor, armnn::DataType::Signed32>( + workloadFactory, + memoryManager, + shape0, + input0, + shape1, + input1, + shape0, + output); +} + +LayerTestResult<int32_t, 4> MultiplicationBroadcast1DVectorInt32Test( + armnn::IWorkloadFactory& workloadFactory, + const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) +{ + const unsigned int shape0[] = { 1, 2, 2, 3 }; + const unsigned int shape1[] = { 1, 1, 1, 3 }; + + std::vector<int32_t> input0 = + { + 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12 + }; + + std::vector<int32_t> input1 = { 1, 2, 3 }; + + std::vector<int32_t> output = + { + 1, 4, 9, 4, 10, 18, + 7, 16, 27, 10, 22, 36 + }; + + return ElementwiseTestHelper<4, armnn::MultiplicationQueueDescriptor, armnn::DataType::Signed32>( + workloadFactory, + memoryManager, + shape0, + input0, + shape1, + input1, + shape0, + output); +} + LayerTestResult<float,4> CompareMultiplicationTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager, |