aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmark
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2019-02-18 20:08:02 +0000
committerGiuseppe Rossini <giuseppe.rossini@arm.com>2019-03-05 11:44:18 +0000
commit574775c7fa78a094bbeb7f9f87aca832936884e2 (patch)
treea405e7a265865acc1348860514de28de2835ce24 /tests/benchmark
parent79fa9a22022824735986f74557bf38095eb2284d (diff)
downloadComputeLibrary-574775c7fa78a094bbeb7f9f87aca832936884e2.tar.gz
COMPMID-1937: Adds support for DequantizationLayer for NEON/CL.
Change-Id: I4b73edd176a277294e0e42e642460bc61210778a Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-on: https://review.mlplatform.org/c/744 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Giuseppe Rossini <giuseppe.rossini@arm.com>
Diffstat (limited to 'tests/benchmark')
-rw-r--r--tests/benchmark/CL/DequantizationLayer.cpp8
-rw-r--r--tests/benchmark/NEON/DequantizationLayer.cpp10
-rw-r--r--tests/benchmark/fixtures/DequantizationLayerFixture.h19
3 files changed, 16 insertions, 21 deletions
diff --git a/tests/benchmark/CL/DequantizationLayer.cpp b/tests/benchmark/CL/DequantizationLayer.cpp
index d34034eaa6..1998b1c589 100644
--- a/tests/benchmark/CL/DequantizationLayer.cpp
+++ b/tests/benchmark/CL/DequantizationLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -41,8 +41,8 @@ namespace benchmark
{
namespace
{
-const auto data_types_src = framework::dataset::make("DataType", { DataType::U8 });
-const auto data_types_dst = framework::dataset::make("DataType", { DataType::F32 });
+const auto data_types_src = framework::dataset::make("DataType", { DataType::QASYMM8 });
+const auto data_types_dst = framework::dataset::make("DataType", { DataType::F16, DataType::F32 });
} // namespace
using CLDequantizationLayerFixture = DequantizationLayerFixture<CLTensor, CLDequantizationLayer, CLAccessor>;
@@ -53,7 +53,7 @@ REGISTER_FIXTURE_DATA_TEST_CASE(DequantizationLayer, CLDequantizationLayerFixtur
framework::DatasetMode::ALL,
framework::dataset::combine(framework::dataset::combine(datasets::Small3DShapes(), data_types_src), data_types_dst));
-TEST_SUITE_END()
+TEST_SUITE_END() // CL
} // namespace benchmark
} // namespace test
} // namespace arm_compute
diff --git a/tests/benchmark/NEON/DequantizationLayer.cpp b/tests/benchmark/NEON/DequantizationLayer.cpp
index 9a0a1e71ba..2ffa8a1c3f 100644
--- a/tests/benchmark/NEON/DequantizationLayer.cpp
+++ b/tests/benchmark/NEON/DequantizationLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -41,8 +41,12 @@ namespace benchmark
{
namespace
{
-const auto data_types_src = framework::dataset::make("DataType", { DataType::U8 });
+const auto data_types_src = framework::dataset::make("DataType", { DataType::QASYMM8 });
+#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
+const auto data_types_dst = framework::dataset::make("DataType", { DataType::F16, DataType::F32 });
+#else /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
const auto data_types_dst = framework::dataset::make("DataType", { DataType::F32 });
+#endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
} // namespace
using NEDequantizationLayerFixture = DequantizationLayerFixture<Tensor, NEDequantizationLayer, Accessor>;
@@ -53,7 +57,7 @@ REGISTER_FIXTURE_DATA_TEST_CASE(DequantizationLayer, NEDequantizationLayerFixtur
framework::DatasetMode::ALL,
framework::dataset::combine(framework::dataset::combine(datasets::Small3DShapes(), data_types_src), data_types_dst));
-TEST_SUITE_END()
+TEST_SUITE_END() // NEON
} // namespace benchmark
} // namespace test
} // namespace arm_compute
diff --git a/tests/benchmark/fixtures/DequantizationLayerFixture.h b/tests/benchmark/fixtures/DequantizationLayerFixture.h
index 5ea8b2d437..316098b220 100644
--- a/tests/benchmark/fixtures/DequantizationLayerFixture.h
+++ b/tests/benchmark/fixtures/DequantizationLayerFixture.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -44,25 +44,18 @@ public:
template <typename...>
void setup(TensorShape shape, DataType data_type_src, DataType data_type_dst)
{
- TensorShape shape_min_max = shape;
- shape_min_max.set(Window::DimX, 2);
-
- // Remove Y and Z dimensions and keep the batches
- shape_min_max.remove_dimension(1);
- shape_min_max.remove_dimension(1);
+ const QuantizationInfo q_info(0.5f, -10);
// Create tensors
- src = create_tensor<TensorType>(shape, data_type_src);
- dst = create_tensor<TensorType>(shape, data_type_dst);
- min_max = create_tensor<TensorType>(shape_min_max, data_type_dst);
+ src = create_tensor<TensorType>(shape, data_type_src, 1, q_info);
+ dst = create_tensor<TensorType>(shape, data_type_dst, 1, q_info);
// Create and configure function
- dequantization_func.configure(&src, &dst, &min_max);
+ dequantization_func.configure(&src, &dst);
// Allocate tensors
src.allocator()->allocate();
dst.allocator()->allocate();
- min_max.allocator()->allocate();
}
void run()
@@ -80,13 +73,11 @@ public:
{
src.allocator()->free();
dst.allocator()->free();
- min_max.allocator()->free();
}
private:
TensorType src{};
TensorType dst{};
- TensorType min_max{};
Function dequantization_func{};
};
} // namespace benchmark