diff options
author | Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> | 2019-06-14 15:45:03 +0100 |
---|---|---|
committer | Áron Virginás-Tar <aron.virginas-tar@arm.com> | 2019-06-17 10:03:58 +0000 |
commit | 44cfd848c1913f87a77c0427450dba93ba47fb94 (patch) | |
tree | a0260bf155f06879042a30c2e8dafe66fc9718a4 /test/1.1 | |
parent | cd700e4f0db201bc3066605058dc1c87d483833f (diff) | |
download | android-nn-driver-44cfd848c1913f87a77c0427450dba93ba47fb94.tar.gz |
IVGCVSW-3283 Add test for converting CONV2D and DEPTHWISE_CONV2D operators with dilation params
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com>
Change-Id: I51a9c71d7a277ab530ac35faea2e8a069c134f45
Diffstat (limited to 'test/1.1')
-rw-r--r-- | test/1.1/Mean.cpp | 23 | ||||
-rw-r--r-- | test/1.1/Transpose.cpp | 32 |
2 files changed, 39 insertions, 16 deletions
diff --git a/test/1.1/Mean.cpp b/test/1.1/Mean.cpp index cf9ddcb2..6e96d84b 100644 --- a/test/1.1/Mean.cpp +++ b/test/1.1/Mean.cpp @@ -6,6 +6,8 @@ #include "../DriverTestHelpers.hpp" #include "../TestTensor.hpp" +#include "../1.1/HalPolicy.hpp" + #include <boost/array.hpp> #include <boost/test/data/test_case.hpp> @@ -15,6 +17,8 @@ using namespace android::hardware; using namespace driverTestHelpers; using namespace armnn_driver; +using HalPolicy = hal_1_1::HalPolicy; + namespace { @@ -34,14 +38,21 @@ void MeanTestImpl(const TestTensor& input, { auto driver = std::make_unique<ArmnnDriver>(DriverOptions(computeDevice, fp16Enabled)); - V1_1::Model model = {}; - AddInputOperand (model, input.GetDimensions()); - AddTensorOperand(model, axisDimensions, const_cast<int32_t*>(axisValues), V1_0::OperandType::TENSOR_INT32); - AddIntOperand (model, keepDims); - AddOutputOperand(model, expectedOutput.GetDimensions()); + HalPolicy::Model model = {}; + + AddInputOperand<HalPolicy>(model, input.GetDimensions()); + + AddTensorOperand<HalPolicy>(model, + axisDimensions, + const_cast<int32_t*>(axisValues), + HalPolicy::OperandType::TENSOR_INT32); + + AddIntOperand<HalPolicy>(model, keepDims); + + AddOutputOperand<HalPolicy>(model, expectedOutput.GetDimensions()); model.operations.resize(1); - model.operations[0].type = V1_1::OperationType::MEAN; + model.operations[0].type = HalPolicy::OperationType::MEAN; model.operations[0].inputs = hidl_vec<uint32_t>{ 0, 1, 2 }; model.operations[0].outputs = hidl_vec<uint32_t>{ 3 }; model.relaxComputationFloat32toFloat16 = fp16Enabled; diff --git a/test/1.1/Transpose.cpp b/test/1.1/Transpose.cpp index e32a25fe..f2c77b3f 100644 --- a/test/1.1/Transpose.cpp +++ b/test/1.1/Transpose.cpp @@ -2,14 +2,19 @@ // Copyright © 2017 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // +#include "OperationsUtils.h" + #include "../DriverTestHelpers.hpp" -#include <boost/test/unit_test.hpp> -#include <boost/array.hpp> -#include <log/log.h> #include "../TestTensor.hpp" -#include "OperationsUtils.h" + +#include "../1.1/HalPolicy.hpp" + +#include <boost/array.hpp> +#include <boost/test/unit_test.hpp> #include <boost/test/data/test_case.hpp> +#include <log/log.h> + #include <cmath> BOOST_AUTO_TEST_SUITE(TransposeTests) @@ -18,6 +23,8 @@ using namespace android::hardware; using namespace driverTestHelpers; using namespace armnn_driver; +using HalPolicy = hal_1_1::HalPolicy; + namespace { @@ -31,14 +38,19 @@ void TransposeTestImpl(const TestTensor & inputs, int32_t perm[], const TestTensor & expectedOutputTensor, armnn::Compute computeDevice) { auto driver = std::make_unique<ArmnnDriver>(DriverOptions(computeDevice)); - V1_1::Model model = {}; + HalPolicy::Model model = {}; - AddInputOperand(model,inputs.GetDimensions()); - AddTensorOperand(model, hidl_vec<uint32_t>{4}, perm, V1_0::OperandType::TENSOR_INT32); - AddOutputOperand(model, expectedOutputTensor.GetDimensions()); + AddInputOperand<HalPolicy>(model,inputs.GetDimensions()); + + AddTensorOperand<HalPolicy>(model, + hidl_vec<uint32_t>{4}, + perm, + HalPolicy::OperandType::TENSOR_INT32); + + AddOutputOperand<HalPolicy>(model, expectedOutputTensor.GetDimensions()); model.operations.resize(1); - model.operations[0].type = V1_1::OperationType::TRANSPOSE; + model.operations[0].type = HalPolicy::OperationType::TRANSPOSE; model.operations[0].inputs = hidl_vec<uint32_t>{0, 1}; model.operations[0].outputs = hidl_vec<uint32_t>{2}; @@ -84,8 +96,8 @@ void TransposeTestImpl(const TestTensor & inputs, int32_t perm[], { BOOST_TEST(outdata[i] == expectedOutput[i]); } - } + } // namespace BOOST_DATA_TEST_CASE(Transpose , COMPUTE_DEVICES) |