aboutsummaryrefslogtreecommitdiff
path: root/test/1.1
diff options
context:
space:
mode:
authorNikhil Raj <nikhil.raj@arm.com>2018-09-03 11:25:56 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-09-18 12:40:40 +0100
commit77605826a353981d41f0ee346850d411770535f8 (patch)
tree5cdd4c8cb6768d7651089105ee2884f536d8a34c /test/1.1
parentb0717b5241a15e3e4d37a1b51b6e5fd9a92a664f (diff)
downloadandroid-nn-driver-77605826a353981d41f0ee346850d411770535f8.tar.gz
IVGCVSW-1713 Create a minimum unit test to compare the results
before and after passing the FP16 flag in the Android-nn-driver Change-Id: If8d4ca12421c3bee2526eec98f11d393af822373
Diffstat (limited to 'test/1.1')
-rw-r--r--test/1.1/Convolution2D.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/1.1/Convolution2D.cpp b/test/1.1/Convolution2D.cpp
new file mode 100644
index 00000000..32d5018c
--- /dev/null
+++ b/test/1.1/Convolution2D.cpp
@@ -0,0 +1,52 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include "../DriverTestHelpers.hpp"
+#include "../Convolution2D.hpp"
+#include "../../1.1/HalPolicy.hpp"
+
+#include <boost/test/unit_test.hpp>
+#include <log/log.h>
+
+#include <OperationsUtils.h>
+
+BOOST_AUTO_TEST_SUITE(Convolution2DTests)
+
+using namespace android::hardware;
+using namespace driverTestHelpers;
+using namespace armnn_driver;
+
+namespace driverTestHelpers
+{
+
+void SetModelFp16Flag(V1_1::Model& model, bool fp16Enabled)
+{
+ // Set the fp16 flag in the given model
+ model.relaxComputationFloat32toFloat16 = fp16Enabled;
+}
+
+} // namespace driverTestHelpers
+
+BOOST_AUTO_TEST_CASE(ConvValidPadding_Hal_1_1)
+{
+ PaddingTestImpl<hal_1_1::HalPolicy>(android::nn::kPaddingValid);
+}
+
+BOOST_AUTO_TEST_CASE(ConvSamePadding_Hal_1_1)
+{
+ PaddingTestImpl<hal_1_1::HalPolicy>(android::nn::kPaddingSame);
+}
+
+BOOST_AUTO_TEST_CASE(ConvValidPaddingFp16Flag_Hal_1_1)
+{
+ PaddingTestImpl<hal_1_1::HalPolicy>(android::nn::kPaddingValid, true);
+}
+
+BOOST_AUTO_TEST_CASE(ConvSamePaddingFp16Flag_Hal_1_1)
+{
+ PaddingTestImpl<hal_1_1::HalPolicy>(android::nn::kPaddingSame, true);
+}
+
+BOOST_AUTO_TEST_SUITE_END()