aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMoritz Pflanzer <moritz.pflanzer@arm.com>2017-07-19 12:03:33 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:16:42 +0100
commitec69f93dc63408933d322ec27d0b7049b9a6e07c (patch)
tree1018456b367e2c1b95755f4934dc6536c4407995 /tests
parent04b741277fb6f775a44aa1d06b574c94d8559050 (diff)
downloadComputeLibrary-ec69f93dc63408933d322ec27d0b7049b9a6e07c.tar.gz
COMPMID-415: Add MatrixMultiply benchmark
Change-Id: I62145acae304cc110a33b02717fae393ddab045a Reviewed-on: http://mpd-gerrit.cambridge.arm.com/81008 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmark_new/CL/GEMM.cpp12
-rw-r--r--tests/benchmark_new/NEON/GEMM.cpp6
-rw-r--r--tests/datasets_new/GEMMDataset.h2
-rw-r--r--tests/datasets_new/MatrixMultiplyGEMMDataset.h52
4 files changed, 61 insertions, 11 deletions
diff --git a/tests/benchmark_new/CL/GEMM.cpp b/tests/benchmark_new/CL/GEMM.cpp
index 2fd928d131..7f7f719e86 100644
--- a/tests/benchmark_new/CL/GEMM.cpp
+++ b/tests/benchmark_new/CL/GEMM.cpp
@@ -29,6 +29,7 @@
#include "framework/datasets/Datasets.h"
#include "tests/TypePrinter.h"
#include "tests/datasets_new/GoogLeNetGEMMDataset.h"
+#include "tests/datasets_new/MatrixMultiplyGEMMDataset.h"
#include "tests/fixtures_new/GEMMFixture.h"
namespace arm_compute
@@ -37,20 +38,15 @@ namespace test
{
namespace
{
-auto data_types = framework::dataset::make("DataType",
-{
-#if ARM_COMPUTE_ENABLE_FP16
- DataType::FP16,
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
- DataType::F32
-});
+const auto data_types = framework::dataset::make("DataType", { DataType::F16, DataType::F32 });
} // namespace
using CLGEMMFixture = GEMMFixture<CLTensor, CLGEMM>;
TEST_SUITE(CL)
-REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetGEMM, CLGEMMFixture, framework::DatasetMode::ALL, framework::dataset::combine(datasets::GoogLeNetGEMMDataset(), std::move(data_types)));
+REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetGEMM, CLGEMMFixture, framework::DatasetMode::ALL, framework::dataset::combine(datasets::GoogLeNetGEMMDataset(), data_types));
+REGISTER_FIXTURE_DATA_TEST_CASE(MatrixMultiplyGEMM, CLGEMMFixture, framework::DatasetMode::ALL, framework::dataset::combine(datasets::MatrixMultiplyGEMMDataset(), data_types));
TEST_SUITE_END()
} // namespace test
diff --git a/tests/benchmark_new/NEON/GEMM.cpp b/tests/benchmark_new/NEON/GEMM.cpp
index 640ec1c032..58d5864ba6 100644
--- a/tests/benchmark_new/NEON/GEMM.cpp
+++ b/tests/benchmark_new/NEON/GEMM.cpp
@@ -30,6 +30,7 @@
#include "framework/datasets/Datasets.h"
#include "tests/TypePrinter.h"
#include "tests/datasets_new/GoogLeNetGEMMDataset.h"
+#include "tests/datasets_new/MatrixMultiplyGEMMDataset.h"
#include "tests/fixtures_new/GEMMFixture.h"
namespace arm_compute
@@ -38,7 +39,7 @@ namespace test
{
namespace
{
-auto data_types = framework::dataset::make("DataType",
+const auto data_types = framework::dataset::make("DataType",
{
#if ARM_COMPUTE_ENABLE_FP16
DataType::F16,
@@ -52,7 +53,8 @@ using NEGEMMFixture = GEMMFixture<Tensor, NEGEMM>;
TEST_SUITE(NEON)
-REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetGEMM, NEGEMMFixture, framework::DatasetMode::ALL, framework::dataset::combine(datasets::GoogLeNetGEMMDataset(), std::move(data_types)));
+REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetGEMM, NEGEMMFixture, framework::DatasetMode::ALL, framework::dataset::combine(datasets::GoogLeNetGEMMDataset(), data_types));
+REGISTER_FIXTURE_DATA_TEST_CASE(MatrixMultiplyGEMM, NEGEMMFixture, framework::DatasetMode::ALL, framework::dataset::combine(datasets::MatrixMultiplyGEMMDataset(), data_types));
TEST_SUITE_END()
} // namespace test
diff --git a/tests/datasets_new/GEMMDataset.h b/tests/datasets_new/GEMMDataset.h
index 8c080aa0a9..bb8a328b0c 100644
--- a/tests/datasets_new/GEMMDataset.h
+++ b/tests/datasets_new/GEMMDataset.h
@@ -63,7 +63,7 @@ public:
description << "B=" << *_b_it << ":";
description << "C=" << *_c_it << ":";
description << "Out=" << *_dst_it << ":";
- description << "Alpha=" << *_alpha_it;
+ description << "Alpha=" << *_alpha_it << ":";
description << "Beta=" << *_beta_it;
return description.str();
}
diff --git a/tests/datasets_new/MatrixMultiplyGEMMDataset.h b/tests/datasets_new/MatrixMultiplyGEMMDataset.h
new file mode 100644
index 0000000000..3c482cb244
--- /dev/null
+++ b/tests/datasets_new/MatrixMultiplyGEMMDataset.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017 ARM Limited.
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+#ifndef ARM_COMPUTE_TEST_MATRIXMULTIPLY_GEMM_DATASET
+#define ARM_COMPUTE_TEST_MATRIXMULTIPLY_GEMM_DATASET
+
+#include "tests/datasets_new/GEMMDataset.h"
+
+#include "tests/TypePrinter.h"
+
+#include "arm_compute/core/TensorShape.h"
+
+namespace arm_compute
+{
+namespace test
+{
+namespace datasets
+{
+class MatrixMultiplyGEMMDataset final : public GEMMDataset
+{
+public:
+ MatrixMultiplyGEMMDataset()
+ {
+ add_config(TensorShape(1024U, 1U), TensorShape(1000U, 1024U), TensorShape(1000U, 1U), TensorShape(1000U, 1U), 1.0f, 0.0f);
+ add_config(TensorShape(256U, 784U), TensorShape(64U, 256U), TensorShape(64U, 784U), TensorShape(64U, 784U), 1.0f, 0.0f);
+ add_config(TensorShape(1152U, 2704U), TensorShape(256U, 1152U), TensorShape(256U, 2704U), TensorShape(256U, 2704U), 1.0f, 0.0f);
+ }
+};
+} // namespace datasets
+} // namespace test
+} // namespace arm_compute
+#endif /* ARM_COMPUTE_TEST_MATRIXMULTIPLY_GEMM_DATASET */