aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmark_new
diff options
context:
space:
mode:
authorsteniu01 <steven.niu@arm.com>2017-07-28 14:40:58 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:16:42 +0100
commita629da13544c361ba9580a233109b2418fd6bb73 (patch)
tree7097c661b2455cd9ad008c314eab1bfea7fdf1f4 /tests/benchmark_new
parentc51b72fe34e6018a1807a2c78228da7beeee1750 (diff)
downloadComputeLibrary-a629da13544c361ba9580a233109b2418fd6bb73.tar.gz
COMPMID-458 add direct convolution to benchmark
Change-Id: I475cb1e3c69831aa5574305e9188251846cee6ba Reviewed-on: http://mpd-gerrit.cambridge.arm.com/82008 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/benchmark_new')
-rw-r--r--tests/benchmark_new/CL/DirectConvolutionLayer.cpp63
-rw-r--r--tests/benchmark_new/CL/SYSTEM/AlexNet.cpp2
-rw-r--r--tests/benchmark_new/NEON/DirectConvolutionLayer.cpp33
-rw-r--r--tests/benchmark_new/NEON/SYSTEM/AlexNet.cpp2
4 files changed, 91 insertions, 9 deletions
diff --git a/tests/benchmark_new/CL/DirectConvolutionLayer.cpp b/tests/benchmark_new/CL/DirectConvolutionLayer.cpp
new file mode 100644
index 0000000000..5a4536ceef
--- /dev/null
+++ b/tests/benchmark_new/CL/DirectConvolutionLayer.cpp
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+#include "arm_compute/core/TensorShape.h"
+#include "arm_compute/core/Types.h"
+#include "arm_compute/runtime/CL/CLTensor.h"
+#include "arm_compute/runtime/CL/CLTensorAllocator.h"
+#include "arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h"
+#include "framework/Macros.h"
+#include "framework/datasets/Datasets.h"
+#include "tests/CL/CLAccessor.h"
+#include "tests/TypePrinter.h"
+#include "tests/datasets_new/AlexNetConvolutionLayerDataset.h"
+#include "tests/datasets_new/GoogLeNetConvolutionLayerDataset.h"
+#include "tests/datasets_new/SqueezeNetConvolutionLayerDataset.h"
+#include "tests/fixtures_new/ConvolutionLayerFixture.h"
+
+namespace arm_compute
+{
+namespace test
+{
+using CLConvolutionLayerFixture = ConvolutionLayerFixture<CLTensor, CLDirectConvolutionLayer, CLAccessor>;
+
+TEST_SUITE(CL)
+
+REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetDirectConvolutionLayer, CLConvolutionLayerFixture, framework::DatasetMode::ALL,
+ framework::dataset::combine(framework::dataset::combine(datasets::AlexNetDirectConvolutionLayerDataset(),
+ framework::dataset::make("DataType", { DataType::F32 })),
+ framework::dataset::make("Batches", { 1, 4, 8 })));
+
+REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetDirectConvolutionLayer, CLConvolutionLayerFixture, framework::DatasetMode::ALL,
+ framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetDirectConvolutionLayerDataset(),
+ framework::dataset::make("DataType", DataType::F32)),
+ framework::dataset::make("Batches", { 1, 4, 8 })));
+
+REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetDirectConvolutionLayer, CLConvolutionLayerFixture, framework::DatasetMode::ALL,
+ framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetConvolutionLayerDataset(),
+ framework::dataset::make("DataType", DataType::F32)),
+ framework::dataset::make("Batches", { 1, 4, 8 })));
+
+TEST_SUITE_END()
+} // namespace test
+} // namespace arm_compute
diff --git a/tests/benchmark_new/CL/SYSTEM/AlexNet.cpp b/tests/benchmark_new/CL/SYSTEM/AlexNet.cpp
index e6d91d9706..271ed9904e 100644
--- a/tests/benchmark_new/CL/SYSTEM/AlexNet.cpp
+++ b/tests/benchmark_new/CL/SYSTEM/AlexNet.cpp
@@ -28,6 +28,7 @@
#include "arm_compute/runtime/CL/CLTensorAllocator.h"
#include "arm_compute/runtime/CL/functions/CLActivationLayer.h"
#include "arm_compute/runtime/CL/functions/CLConvolutionLayer.h"
+#include "arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h"
#include "arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h"
#include "arm_compute/runtime/CL/functions/CLNormalizationLayer.h"
#include "arm_compute/runtime/CL/functions/CLPoolingLayer.h"
@@ -48,6 +49,7 @@ using CLAlexNetFixture = AlexNetFixture<ICLTensor,
CLAccessor,
CLActivationLayer,
CLConvolutionLayer,
+ CLDirectConvolutionLayer,
CLFullyConnectedLayer,
CLNormalizationLayer,
CLPoolingLayer,
diff --git a/tests/benchmark_new/NEON/DirectConvolutionLayer.cpp b/tests/benchmark_new/NEON/DirectConvolutionLayer.cpp
index dcefbc7512..c4eec697af 100644
--- a/tests/benchmark_new/NEON/DirectConvolutionLayer.cpp
+++ b/tests/benchmark_new/NEON/DirectConvolutionLayer.cpp
@@ -30,7 +30,9 @@
#include "framework/datasets/Datasets.h"
#include "tests/NEON/Accessor.h"
#include "tests/TypePrinter.h"
-#include "tests/datasets_new/DirectConvolutionLayerDataset.h"
+#include "tests/datasets_new/AlexNetConvolutionLayerDataset.h"
+#include "tests/datasets_new/GoogLeNetConvolutionLayerDataset.h"
+#include "tests/datasets_new/SqueezeNetConvolutionLayerDataset.h"
#include "tests/fixtures_new/ConvolutionLayerFixture.h"
namespace arm_compute
@@ -39,19 +41,32 @@ namespace test
{
namespace
{
-#ifdef ARM_COMPUTE_ENABLE_FP16
-const auto data_types = framework::dataset::make("DataType", { DataType::QS8, DataType::F16, DataType::F32 });
-#else /* ARM_COMPUTE_ENABLE_FP16 */
-const auto data_types = framework::dataset::make("DataType", { DataType::QS8, DataType::F32 });
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
+#ifdef ARM_COMPUTE_ENABLE_F16
+const auto alexnet_data_types = framework::dataset::make("DataType", { DataType::QS8, DataType::F16, DataType::F32 });
+const auto googlenet_data_types = framework::dataset::make("DataType", { DataType::QS8, DataType::F16, DataType::F32 });
+const auto squeezenet_data_types = framework::dataset::make("DataType", { DataType::QS8, DataType::F16, DataType::F32 });
+#else /* ARM_COMPUTE_ENABLE_F16 */
+const auto alexnet_data_types = framework::dataset::make("DataType", { DataType::QS8, DataType::F32 });
+const auto googlenet_data_types = framework::dataset::make("DataType", { DataType::QS8, DataType::F32 });
+const auto squeezenet_data_types = framework::dataset::make("DataType", { DataType::QS8, DataType::F32 });
+#endif /* ARM_COMPUTE_ENABLE_F16 */
} // namespace
-using NEDirectConvolutionLayerFixture = ConvolutionLayerFixture<Tensor, NEDirectConvolutionLayer, Accessor>;
+using NEConvolutionLayerFixture = ConvolutionLayerFixture<Tensor, NEDirectConvolutionLayer, Accessor>;
TEST_SUITE(NEON)
-REGISTER_FIXTURE_DATA_TEST_CASE(DirectConvolutionLayer, NEDirectConvolutionLayerFixture, framework::DatasetMode::ALL,
- framework::dataset::combine(framework::dataset::combine(datasets::DirectConvolutionLayerDataset(), data_types), framework::dataset::make("Batches", { 1, 4, 8 })));
+REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetDirectConvolutionLayer, NEConvolutionLayerFixture, framework::DatasetMode::ALL,
+ framework::dataset::combine(framework::dataset::combine(datasets::AlexNetDirectConvolutionLayerDataset(), alexnet_data_types),
+ framework::dataset::make("Batches", { 1, 4, 8 })));
+
+REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetDirectConvolutionLayer, NEConvolutionLayerFixture, framework::DatasetMode::ALL,
+ framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetDirectConvolutionLayerDataset(), googlenet_data_types),
+ framework::dataset::make("Batches", { 1, 4, 8 })));
+
+REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetDirectConvolutionLayer, NEConvolutionLayerFixture, framework::DatasetMode::ALL,
+ framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetConvolutionLayerDataset(), squeezenet_data_types),
+ framework::dataset::make("Batches", { 1, 4, 8 })));
TEST_SUITE_END()
} // namespace test
diff --git a/tests/benchmark_new/NEON/SYSTEM/AlexNet.cpp b/tests/benchmark_new/NEON/SYSTEM/AlexNet.cpp
index 282d3e67bd..b186c9b966 100644
--- a/tests/benchmark_new/NEON/SYSTEM/AlexNet.cpp
+++ b/tests/benchmark_new/NEON/SYSTEM/AlexNet.cpp
@@ -25,6 +25,7 @@
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/NEON/functions/NEActivationLayer.h"
#include "arm_compute/runtime/NEON/functions/NEConvolutionLayer.h"
+#include "arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h"
#include "arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h"
#include "arm_compute/runtime/NEON/functions/NENormalizationLayer.h"
#include "arm_compute/runtime/NEON/functions/NEPoolingLayer.h"
@@ -57,6 +58,7 @@ using NEAlexNetFixture = AlexNetFixture<ITensor,
Accessor,
NEActivationLayer,
NEConvolutionLayer,
+ NEDirectConvolutionLayer,
NEFullyConnectedLayer,
NENormalizationLayer,
NEPoolingLayer,