diff options
author | Moritz Pflanzer <moritz.pflanzer@arm.com> | 2017-07-17 13:50:12 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-09-17 14:16:42 +0100 |
commit | d03b00acd71847fa2db1c5308c87d3b57c781bf9 (patch) | |
tree | 7c58283ca1a067428ccafd0f310c8c0e89800306 /tests | |
parent | ee493ae23b8cd6de5a6c578cea34bccb478d2f64 (diff) | |
download | ComputeLibrary-d03b00acd71847fa2db1c5308c87d3b57c781bf9.tar.gz |
COMPMID-415: Fix dataset modes
Change-Id: I266e8a22890c914edb3335104f073e79d2bf0ad9
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/80766
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests')
20 files changed, 43 insertions, 227 deletions
diff --git a/tests/DatasetManager.cpp b/tests/DatasetManager.cpp deleted file mode 100644 index fbc40e64cd..0000000000 --- a/tests/DatasetManager.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 "DatasetManager.h" - -#include <map> - -namespace arm_compute -{ -namespace test -{ -DatasetManager &DatasetManager::get() -{ - static DatasetManager instance; - return instance; -} - -void DatasetManager::set_mode(DatasetMode mode) -{ - _mode = mode; -} - -DatasetManager::ShapesDataset DatasetManager::shapesDataset() const -{ - static const std::string name = "Shape"; - static const std::vector<arm_compute::TensorShape> shapes{ arm_compute::TensorShape(1U), arm_compute::TensorShape(2U), arm_compute::TensorShape(3U), arm_compute::TensorShape(10U), arm_compute::TensorShape(20U), arm_compute::TensorShape(30U) }; - - switch(_mode) - { - case DatasetManager::DatasetMode::PRECOMMIT: - return framework::dataset::make(name, shapes.cbegin(), shapes.cbegin() + 3); - break; - case DatasetManager::DatasetMode::NIGHTLY: - return framework::dataset::make(name, shapes.cbegin() + 3, shapes.cend()); - break; - case DatasetManager::DatasetMode::ALL: - // Fallthrough - default: - return framework::dataset::make(name, shapes.cbegin(), shapes.cend()); - } -} - -DatasetManager::DatasetMode dataset_mode_from_name(const std::string &name) -{ - static const std::map<std::string, DatasetManager::DatasetMode> modes = - { - { "all", DatasetManager::DatasetMode::ALL }, - { "precommit", DatasetManager::DatasetMode::PRECOMMIT }, - { "nightly", DatasetManager::DatasetMode::NIGHTLY }, - }; - - try - { - return modes.at(name); - } - catch(const std::out_of_range &) - { - throw std::invalid_argument(name); - } -} -} // namespace test -} // namespace arm_compute diff --git a/tests/DatasetManager.h b/tests/DatasetManager.h deleted file mode 100644 index 2080203286..0000000000 --- a/tests/DatasetManager.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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_DATASETMANAGER -#define ARM_COMPUTE_TEST_DATASETMANAGER - -#include "arm_compute/core/TensorShape.h" -#include "framework/datasets/Datasets.h" - -#include <sstream> -#include <stdexcept> -#include <string> - -namespace arm_compute -{ -namespace test -{ -class DatasetManager final -{ -public: - enum class DatasetMode : unsigned int - { - ALL = 0, - PRECOMMIT = 1, - NIGHTLY = 2 - }; - - using ShapesDataset = framework::dataset::RangeDataset<std::vector<arm_compute::TensorShape>::const_iterator>; - - static DatasetManager &get(); - - void set_mode(DatasetMode mode); - - ShapesDataset shapesDataset() const; - -private: - DatasetManager() = default; - ~DatasetManager() = default; - - DatasetMode _mode{ DatasetMode::ALL }; -}; - -DatasetManager::DatasetMode dataset_mode_from_name(const std::string &name); - -inline ::std::stringstream &operator>>(::std::stringstream &stream, DatasetManager::DatasetMode &mode) -{ - std::string value; - stream >> value; - mode = dataset_mode_from_name(value); - return stream; -} - -inline ::std::stringstream &operator<<(::std::stringstream &stream, DatasetManager::DatasetMode mode) -{ - switch(mode) - { - case DatasetManager::DatasetMode::PRECOMMIT: - stream << "PRECOMMIT"; - break; - case DatasetManager::DatasetMode::NIGHTLY: - stream << "NIGHTLY"; - break; - case DatasetManager::DatasetMode::ALL: - stream << "ALL"; - break; - default: - throw std::invalid_argument("Unsupported dataset mode"); - } - - return stream; -} - -inline std::string to_string(const DatasetManager::DatasetMode &mode) -{ - std::stringstream stream; - stream << mode; - return stream.str(); -} -} // namespace test -} // namespace arm_compute -#endif /* ARM_COMPUTE_TEST_DATASETMANAGER */ diff --git a/tests/benchmark_new/CL/ActivationLayer.cpp b/tests/benchmark_new/CL/ActivationLayer.cpp index 2ab23d292f..7ce222925c 100644 --- a/tests/benchmark_new/CL/ActivationLayer.cpp +++ b/tests/benchmark_new/CL/ActivationLayer.cpp @@ -41,17 +41,17 @@ using CLActivationLayerFixture = ActivationLayerFixture<CLTensor, CLActivationLa TEST_SUITE(CL) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetActivationLayer, CLActivationLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetActivationLayer, CLActivationLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::AlexNetActivationLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ActivationLayer, CLActivationLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ActivationLayer, CLActivationLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::LeNet5ActivationLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetActivationLayer, CLActivationLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetActivationLayer, CLActivationLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetActivationLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/CL/ConvolutionLayer.cpp b/tests/benchmark_new/CL/ConvolutionLayer.cpp index b0faf4ac0f..88eb2fe6ab 100644 --- a/tests/benchmark_new/CL/ConvolutionLayer.cpp +++ b/tests/benchmark_new/CL/ConvolutionLayer.cpp @@ -43,17 +43,17 @@ using CLConvolutionLayerFixture = ConvolutionLayerFixture<CLTensor, CLConvolutio TEST_SUITE(CL) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetConvolutionLayer, CLConvolutionLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetConvolutionLayer, CLConvolutionLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::AlexNetConvolutionLayerDataset(), framework::dataset::make("Data type", { DataType::F32 })), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ConvolutionLayer, CLConvolutionLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ConvolutionLayer, CLConvolutionLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::LeNet5ConvolutionLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetConvolutionLayer, CLConvolutionLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetConvolutionLayer, CLConvolutionLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetConvolutionLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/CL/FullyConnectedLayer.cpp b/tests/benchmark_new/CL/FullyConnectedLayer.cpp index 3c8d450498..f2ada4d47a 100644 --- a/tests/benchmark_new/CL/FullyConnectedLayer.cpp +++ b/tests/benchmark_new/CL/FullyConnectedLayer.cpp @@ -43,17 +43,17 @@ using CLFullyConnectedLayerFixture = FullyConnectedLayerFixture<CLTensor, CLFull TEST_SUITE(CL) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetFullyConnectedLayer, CLFullyConnectedLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetFullyConnectedLayer, CLFullyConnectedLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::AlexNetFullyConnectedLayerDataset(), framework::dataset::make("Data type", { DataType::F32 })), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5FullyConnectedLayer, CLFullyConnectedLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5FullyConnectedLayer, CLFullyConnectedLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::LeNet5FullyConnectedLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetFullyConnectedLayer, CLFullyConnectedLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetFullyConnectedLayer, CLFullyConnectedLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetFullyConnectedLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/CL/GEMM.cpp b/tests/benchmark_new/CL/GEMM.cpp index d75db500a0..e46175590e 100644 --- a/tests/benchmark_new/CL/GEMM.cpp +++ b/tests/benchmark_new/CL/GEMM.cpp @@ -50,7 +50,7 @@ using CLGEMMFixture = GEMMFixture<CLTensor, CLGEMM>; TEST_SUITE(CL) -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetGEMM, CLGEMMFixture, framework::dataset::combine(datasets::GoogLeNetGEMMDataset(), std::move(data_types))); +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetGEMM, CLGEMMFixture, framework::DatasetMode::ALL, framework::dataset::combine(datasets::GoogLeNetGEMMDataset(), std::move(data_types))); TEST_SUITE_END() } // namespace test diff --git a/tests/benchmark_new/CL/NormalizationLayer.cpp b/tests/benchmark_new/CL/NormalizationLayer.cpp index 95e78c4a18..088d8739d0 100644 --- a/tests/benchmark_new/CL/NormalizationLayer.cpp +++ b/tests/benchmark_new/CL/NormalizationLayer.cpp @@ -41,12 +41,12 @@ using CLNormalizationLayerFixture = NormalizationLayerFixture<CLTensor, CLNormal TEST_SUITE(CL) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetNormalizationLayer, CLNormalizationLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetNormalizationLayer, CLNormalizationLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::AlexNetNormalizationLayerDataset(), framework::dataset::make("Data type", { DataType::F32 })), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetNormalizationLayer, CLNormalizationLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetNormalizationLayer, CLNormalizationLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetNormalizationLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/CL/PoolingLayer.cpp b/tests/benchmark_new/CL/PoolingLayer.cpp index 1f2229cb10..2dc0951d38 100644 --- a/tests/benchmark_new/CL/PoolingLayer.cpp +++ b/tests/benchmark_new/CL/PoolingLayer.cpp @@ -43,17 +43,17 @@ using CLPoolingLayerFixture = PoolingLayerFixture<CLTensor, CLPoolingLayer, cl:: TEST_SUITE(CL) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetPoolingLayer, CLPoolingLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetPoolingLayer, CLPoolingLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::AlexNetPoolingLayerDataset(), framework::dataset::make("Data type", { DataType::F32 })), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5PoolingLayer, CLPoolingLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5PoolingLayer, CLPoolingLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::LeNet5PoolingLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetPoolingLayer, CLPoolingLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetPoolingLayer, CLPoolingLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetPoolingLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/CL/SYSTEM/AlexNet.cpp b/tests/benchmark_new/CL/SYSTEM/AlexNet.cpp index a0673b94df..90c15c536a 100644 --- a/tests/benchmark_new/CL/SYSTEM/AlexNet.cpp +++ b/tests/benchmark_new/CL/SYSTEM/AlexNet.cpp @@ -57,7 +57,7 @@ using CLAlexNetFixture = AlexNetFixture<ICLTensor, TEST_SUITE(SYSTEM_TEST) TEST_SUITE(CL) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNet, CLAlexNetFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNet, CLAlexNetFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::make("Data type", DataType::F32), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/CL/SYSTEM/LeNet5.cpp b/tests/benchmark_new/CL/SYSTEM/LeNet5.cpp index 0ee7c0177a..b25fb685bf 100644 --- a/tests/benchmark_new/CL/SYSTEM/LeNet5.cpp +++ b/tests/benchmark_new/CL/SYSTEM/LeNet5.cpp @@ -51,7 +51,7 @@ using CLLeNet5Fixture = LeNet5Fixture<CLTensor, TEST_SUITE(SYSTEM_TEST) TEST_SUITE(CL) -REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5, CLLeNet5Fixture, +REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5, CLLeNet5Fixture, framework::DatasetMode::ALL, framework::dataset::make("Batches", { 1, 4, 8 })); TEST_SUITE_END() diff --git a/tests/benchmark_new/NEON/ActivationLayer.cpp b/tests/benchmark_new/NEON/ActivationLayer.cpp index 75e98c4ccb..ee8d6633aa 100644 --- a/tests/benchmark_new/NEON/ActivationLayer.cpp +++ b/tests/benchmark_new/NEON/ActivationLayer.cpp @@ -41,17 +41,17 @@ using NEActivationLayerFixture = ActivationLayerFixture<Tensor, NEActivationLaye TEST_SUITE(NEON) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetActivationLayer, NEActivationLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetActivationLayer, NEActivationLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::AlexNetActivationLayerDataset(), framework::dataset::make("Data type", { DataType::F32, DataType::QS8 })), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ActivationLayer, NEActivationLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ActivationLayer, NEActivationLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::LeNet5ActivationLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetActivationLayer, NEActivationLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetActivationLayer, NEActivationLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetActivationLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/NEON/ConvolutionLayer.cpp b/tests/benchmark_new/NEON/ConvolutionLayer.cpp index 57d046e9a5..3d9b2a3acf 100644 --- a/tests/benchmark_new/NEON/ConvolutionLayer.cpp +++ b/tests/benchmark_new/NEON/ConvolutionLayer.cpp @@ -43,17 +43,17 @@ using NEConvolutionLayerFixture = ConvolutionLayerFixture<Tensor, NEConvolutionL TEST_SUITE(NEON) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetConvolutionLayer, NEConvolutionLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetConvolutionLayer, NEConvolutionLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::AlexNetConvolutionLayerDataset(), framework::dataset::make("Data type", { DataType::F32, DataType::QS8 })), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ConvolutionLayer, NEConvolutionLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ConvolutionLayer, NEConvolutionLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::LeNet5ConvolutionLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetConvolutionLayer, NEConvolutionLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetConvolutionLayer, NEConvolutionLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetConvolutionLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/NEON/DirectConvolutionLayer.cpp b/tests/benchmark_new/NEON/DirectConvolutionLayer.cpp index a63cbae8e5..6610fd3ec9 100644 --- a/tests/benchmark_new/NEON/DirectConvolutionLayer.cpp +++ b/tests/benchmark_new/NEON/DirectConvolutionLayer.cpp @@ -41,7 +41,7 @@ using NEDirectConvolutionLayerFixture = ConvolutionLayerFixture<Tensor, NEDirect TEST_SUITE(NEON) -REGISTER_FIXTURE_DATA_TEST_CASE(DirectConvolutionLayer, NEDirectConvolutionLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(DirectConvolutionLayer, NEDirectConvolutionLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::DirectConvolutionLayerDataset(), framework::dataset::make("Data type", { DataType::F32, DataType::QS8 })), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/NEON/FullyConnectedLayer.cpp b/tests/benchmark_new/NEON/FullyConnectedLayer.cpp index 75815ad363..4a72b27665 100644 --- a/tests/benchmark_new/NEON/FullyConnectedLayer.cpp +++ b/tests/benchmark_new/NEON/FullyConnectedLayer.cpp @@ -43,17 +43,17 @@ using NEFullyConnectedLayerFixture = FullyConnectedLayerFixture<Tensor, NEFullyC TEST_SUITE(NEON) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetFullyConnectedLayer, NEFullyConnectedLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetFullyConnectedLayer, NEFullyConnectedLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::AlexNetFullyConnectedLayerDataset(), framework::dataset::make("Data type", { DataType::F32, DataType::QS8 })), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5FullyConnectedLayer, NEFullyConnectedLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5FullyConnectedLayer, NEFullyConnectedLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::LeNet5FullyConnectedLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetFullyConnectedLayer, NEFullyConnectedLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetFullyConnectedLayer, NEFullyConnectedLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetFullyConnectedLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/NEON/GEMM.cpp b/tests/benchmark_new/NEON/GEMM.cpp index 2ba9a71664..724b514490 100644 --- a/tests/benchmark_new/NEON/GEMM.cpp +++ b/tests/benchmark_new/NEON/GEMM.cpp @@ -52,7 +52,7 @@ using NEGEMMFixture = GEMMFixture<Tensor, NEGEMM>; TEST_SUITE(NEON) -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetGEMM, NEGEMMFixture, framework::dataset::combine(datasets::GoogLeNetGEMMDataset(), std::move(data_types))); +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetGEMM, NEGEMMFixture, framework::DatasetMode::ALL, framework::dataset::combine(datasets::GoogLeNetGEMMDataset(), std::move(data_types))); TEST_SUITE_END() } // namespace test diff --git a/tests/benchmark_new/NEON/NormalizationLayer.cpp b/tests/benchmark_new/NEON/NormalizationLayer.cpp index d9f1323620..8c1f37df0a 100644 --- a/tests/benchmark_new/NEON/NormalizationLayer.cpp +++ b/tests/benchmark_new/NEON/NormalizationLayer.cpp @@ -41,12 +41,12 @@ using NENormalizationLayerFixture = NormalizationLayerFixture<Tensor, NENormaliz TEST_SUITE(NEON) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetNormalizationLayer, NENormalizationLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetNormalizationLayer, NENormalizationLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::AlexNetNormalizationLayerDataset(), framework::dataset::make("Data type", { DataType::F32, DataType::QS8 })), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetNormalizationLayer, NENormalizationLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetNormalizationLayer, NENormalizationLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetNormalizationLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/NEON/PoolingLayer.cpp b/tests/benchmark_new/NEON/PoolingLayer.cpp index fdaadd0493..6100f40653 100644 --- a/tests/benchmark_new/NEON/PoolingLayer.cpp +++ b/tests/benchmark_new/NEON/PoolingLayer.cpp @@ -43,17 +43,17 @@ using NEPoolingLayerFixture = PoolingLayerFixture<Tensor, NEPoolingLayer, neon:: TEST_SUITE(NEON) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetPoolingLayer, NEPoolingLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetPoolingLayer, NEPoolingLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::AlexNetPoolingLayerDataset(), framework::dataset::make("Data type", { DataType::F32, DataType::QS8 })), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5PoolingLayer, NEPoolingLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5PoolingLayer, NEPoolingLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::LeNet5PoolingLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); -REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetPoolingLayer, NEPoolingLayerFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetPoolingLayer, NEPoolingLayerFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetPoolingLayerDataset(), framework::dataset::make("Data type", DataType::F32)), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/NEON/SYSTEM/AlexNet.cpp b/tests/benchmark_new/NEON/SYSTEM/AlexNet.cpp index 2a50bc9d85..8ed70f7a6e 100644 --- a/tests/benchmark_new/NEON/SYSTEM/AlexNet.cpp +++ b/tests/benchmark_new/NEON/SYSTEM/AlexNet.cpp @@ -57,7 +57,7 @@ using NEAlexNetFixture = AlexNetFixture<ITensor, TEST_SUITE(SYSTEM_TEST) TEST_SUITE(NEON) -REGISTER_FIXTURE_DATA_TEST_CASE(AlexNet, NEAlexNetFixture, +REGISTER_FIXTURE_DATA_TEST_CASE(AlexNet, NEAlexNetFixture, framework::DatasetMode::ALL, framework::dataset::combine(framework::dataset::make("Data type", { DataType::F32, DataType::QS8 }), framework::dataset::make("Batches", { 1, 4, 8 }))); diff --git a/tests/benchmark_new/NEON/SYSTEM/LeNet5.cpp b/tests/benchmark_new/NEON/SYSTEM/LeNet5.cpp index 3957ce76b9..9a5c49e975 100644 --- a/tests/benchmark_new/NEON/SYSTEM/LeNet5.cpp +++ b/tests/benchmark_new/NEON/SYSTEM/LeNet5.cpp @@ -51,7 +51,7 @@ using NELeNet5Fixture = LeNet5Fixture<Tensor, TEST_SUITE(SYSTEM_TEST) TEST_SUITE(NEON) -REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5, NELeNet5Fixture, +REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5, NELeNet5Fixture, framework::DatasetMode::ALL, framework::dataset::make("Batches", { 1, 4, 8 })); TEST_SUITE_END() diff --git a/tests/benchmark_new/main.cpp b/tests/benchmark_new/main.cpp index 2db5fc8cef..4c6811e372 100644 --- a/tests/benchmark_new/main.cpp +++ b/tests/benchmark_new/main.cpp @@ -21,13 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +#include "framework/DatasetModes.h" #include "framework/Macros.h" #include "framework/command_line/CommandLineOptions.h" #include "framework/command_line/CommandLineParser.h" #include "framework/instruments/Instruments.h" #include "framework/printers/Printers.h" #include "support/ToolchainSupport.h" -#include "tests/DatasetManager.h" #include "tests/TensorLibrary.h" #ifdef OPENCL @@ -74,11 +74,11 @@ int main(int argc, char **argv) allowed_instruments.insert(type); } - std::set<DatasetManager::DatasetMode> allowed_modes + std::set<framework::DatasetMode> allowed_modes { - DatasetManager::DatasetMode::PRECOMMIT, - DatasetManager::DatasetMode::NIGHTLY, - DatasetManager::DatasetMode::ALL + framework::DatasetMode::PRECOMMIT, + framework::DatasetMode::NIGHTLY, + framework::DatasetMode::ALL }; std::set<framework::LogFormat> supported_log_formats @@ -90,7 +90,7 @@ int main(int argc, char **argv) auto help = parser.add_option<framework::ToggleOption>("help"); help->set_help("Show this help message"); - auto dataset_mode = parser.add_option<framework::EnumOption<DatasetManager::DatasetMode>>("mode", allowed_modes, DatasetManager::DatasetMode::ALL); + auto dataset_mode = parser.add_option<framework::EnumOption<framework::DatasetMode>>("mode", allowed_modes, framework::DatasetMode::ALL); dataset_mode->set_help("For managed datasets select which group to use"); auto instruments = parser.add_option<framework::EnumListOption<framework::InstrumentType>>("instruments", allowed_instruments, std::initializer_list<framework::InstrumentType> { framework::InstrumentType::ALL }); instruments->set_help("Set the profiling instruments to use"); @@ -162,7 +162,6 @@ int main(int argc, char **argv) } } - DatasetManager::get().set_mode(dataset_mode->value()); library = support::cpp14::make_unique<TensorLibrary>(assets->value(), seed->value()); Scheduler::get().set_num_threads(threads->value()); @@ -175,7 +174,7 @@ int main(int argc, char **argv) printer->print_entry("Dataset mode", to_string(dataset_mode->value())); } - framework.init(instruments->value(), iterations->value(), filter->value(), filter_id->value()); + framework.init(instruments->value(), iterations->value(), dataset_mode->value(), filter->value(), filter_id->value()); framework.set_printer(printer.get()); framework.set_throw_errors(throw_errors->value()); @@ -185,7 +184,7 @@ int main(int argc, char **argv) { for(const auto &id : framework.test_ids()) { - std::cout << "[" << id.first << "] " << id.second << "\n"; + std::cout << "[" << std::get<0>(id) << ", " << std::get<2>(id) << "] " << std::get<1>(id) << "\n"; } } else |