aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/test/layerTests/MinimumTestImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/backends/backendsCommon/test/layerTests/MinimumTestImpl.cpp')
-rw-r--r--src/backends/backendsCommon/test/layerTests/MinimumTestImpl.cpp105
1 files changed, 105 insertions, 0 deletions
diff --git a/src/backends/backendsCommon/test/layerTests/MinimumTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/MinimumTestImpl.cpp
index eabad8f852..bf66950686 100644
--- a/src/backends/backendsCommon/test/layerTests/MinimumTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/MinimumTestImpl.cpp
@@ -96,6 +96,111 @@ LayerTestResult<uint8_t, 4> MinimumBroadcast1DVectorUint8Test(
output);
}
+LayerTestResult<armnn::Half, 4> MinimumFloat16Test(
+ armnn::IWorkloadFactory& workloadFactory,
+ const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager)
+{
+ using namespace half_float::literal;
+
+ unsigned int shape[] = { 2, 2, 2, 2 };
+
+ std::vector<armnn::Half> input0 =
+ {
+ 1._h, 1._h, 1._h, 1._h, 6._h, 6._h, 6._h, 6._h,
+ 3._h, 3._h, 3._h, 3._h, 4._h, 4._h, 4._h, 4._h
+ };
+
+ std::vector<armnn::Half> input1 =
+ {
+ 2._h, 2._h, 2._h, 2._h, 3._h, 3._h, 3._h, 3._h,
+ 4._h, 4._h, 4._h, 4._h, 5._h, 5._h, 5._h, 5._h
+ };
+
+ std::vector<armnn::Half> output
+ {
+ 1._h, 1._h, 1._h, 1._h, 3._h, 3._h, 3._h, 3._h,
+ 3._h, 3._h, 3._h, 3._h, 4._h, 4._h, 4._h, 4._h
+ };
+
+ return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Float16>(
+ workloadFactory,
+ memoryManager,
+ shape,
+ input0,
+ shape,
+ input1,
+ shape,
+ output);
+}
+
+LayerTestResult<armnn::Half, 4> MinimumBroadcast1ElementFloat16Test(
+ armnn::IWorkloadFactory& workloadFactory,
+ const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager)
+{
+ using namespace half_float::literal;
+
+ const unsigned int shape0[] = { 1, 2, 2, 3 };
+ const unsigned int shape1[] = { 1, 1, 1, 1 };
+
+ std::vector<armnn::Half> input0 =
+ {
+ 1._h, 2._h, 3._h, 4._h, 5._h, 6._h,
+ 7._h, 8._h, 9._h, 10._h, 11._h, 12._h
+ };
+
+ std::vector<armnn::Half> input1 = { 2._h };
+
+ std::vector<armnn::Half> output =
+ {
+ 1._h, 2._h, 2._h, 2._h, 2._h, 2._h,
+ 2._h, 2._h, 2._h, 2._h, 2._h, 2._h
+ };
+
+ return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Float16>(
+ workloadFactory,
+ memoryManager,
+ shape0,
+ input0,
+ shape1,
+ input1,
+ shape0,
+ output);
+}
+
+LayerTestResult<armnn::Half, 4> MinimumBroadcast1DVectorFloat16Test(
+ armnn::IWorkloadFactory& workloadFactory,
+ const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager)
+{
+ using namespace half_float::literal;
+
+ const unsigned int shape0[] = { 1, 2, 2, 3 };
+ const unsigned int shape1[] = { 1, 1, 1, 3 };
+
+ std::vector<armnn::Half> input0 =
+ {
+ 1._h, 2._h, 3._h, 4._h, 5._h, 6._h,
+ 7._h, 8._h, 9._h, 10._h, 11._h, 12._h
+ };
+
+ std::vector<armnn::Half> input1 = { 1._h, 10._h, 3._h };
+
+ std::vector<armnn::Half> output =
+ {
+ 1._h, 2._h, 3._h, 1._h, 5._h, 3._h,
+ 1._h, 8._h, 3._h, 1._h, 10._h, 3._h
+ };
+
+ return ElementwiseTestHelper<4, armnn::MinimumQueueDescriptor, armnn::DataType::Float16>(
+ workloadFactory,
+ memoryManager,
+ shape0,
+ input0,
+ shape1,
+ input1,
+ shape0,
+ output);
+}
+
LayerTestResult<int16_t, 4> MinimumInt16Test(
armnn::IWorkloadFactory& workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager)