From c357c47be8a3f210f9eee9a05cc13f1051b036d3 Mon Sep 17 00:00:00 2001 From: Alex Gilday Date: Wed, 21 Mar 2018 13:54:09 +0000 Subject: COMPMID-1008: Fix Doxygen issues Change-Id: Ie73d8771f85d1f5b059f3a56f1bbd73c98e94a38 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/124723 Reviewed-by: Michalis Spyrou Tested-by: Jenkins --- tests/framework/Exceptions.h | 6 ++- tests/framework/Framework.h | 10 ++--- tests/framework/Profiler.h | 7 +++- tests/framework/TestCase.h | 11 +++++- tests/framework/TestCaseFactory.h | 3 +- tests/framework/TestResult.h | 6 +-- tests/framework/command_line/CommonOptions.h | 46 +++++++++++----------- tests/framework/command_line/EnumListOption.h | 9 ++++- tests/framework/command_line/EnumOption.h | 9 ++++- tests/framework/command_line/ListOption.h | 9 ++++- tests/framework/command_line/SimpleOption.h | 20 +++++++++- tests/framework/datasets/CartesianProductDataset.h | 34 +++++++++++++++- tests/framework/datasets/ContainerDataset.h | 21 +++++++++- tests/framework/datasets/Dataset.h | 9 ++++- tests/framework/datasets/InitializerListDataset.h | 20 +++++++++- tests/framework/datasets/JoinDataset.h | 18 +++++++++ tests/framework/datasets/RangeDataset.h | 21 +++++++++- tests/framework/datasets/SingletonDataset.h | 27 ++++++++++++- tests/framework/datasets/ZipDataset.h | 20 +++++++++- tests/framework/instruments/Instrument.h | 16 ++++++-- tests/framework/instruments/MaliCounter.h | 9 ++++- tests/framework/instruments/Measurement.h | 13 ++++++ tests/framework/instruments/OpenCLTimer.h | 6 ++- tests/framework/instruments/PMU.h | 10 ++++- tests/framework/instruments/PMUCounter.h | 6 ++- tests/framework/instruments/SchedulerTimer.h | 12 +++++- tests/framework/instruments/WallClockTimer.h | 6 ++- tests/framework/instruments/hwc.hpp | 7 +++- tests/framework/instruments/hwc_names.hpp | 7 +++- tests/framework/printers/Printer.h | 9 ++++- 30 files changed, 339 insertions(+), 68 deletions(-) (limited to 'tests/framework') diff --git a/tests/framework/Exceptions.h b/tests/framework/Exceptions.h index f35c35020c..687305b452 100644 --- a/tests/framework/Exceptions.h +++ b/tests/framework/Exceptions.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -94,6 +94,10 @@ public: */ LogLevel level() const; + /** Get the error message. + * + * @return error message. + */ const char *what() const noexcept override; private: diff --git a/tests/framework/Framework.h b/tests/framework/Framework.h index d7a9cfba9b..65ffc0a818 100644 --- a/tests/framework/Framework.h +++ b/tests/framework/Framework.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -65,10 +65,10 @@ namespace framework */ struct TestInfo { - int id; - std::string name; - DatasetMode mode; - TestCaseFactory::Status status; + int id; /**< Test ID */ + std::string name; /**< Test name */ + DatasetMode mode; /**< Test data set mode */ + TestCaseFactory::Status status; /**< Test status */ }; inline bool operator<(const TestInfo &lhs, const TestInfo &rhs) diff --git a/tests/framework/Profiler.h b/tests/framework/Profiler.h index 930075e214..62a3dee92e 100644 --- a/tests/framework/Profiler.h +++ b/tests/framework/Profiler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -63,7 +63,10 @@ public: /** Stop all added instruments. */ void stop(); - /** Return measurements for all instruments. */ + /** Return measurements for all instruments. + * + * @return measurements for all instruments. + */ const MeasurementsMap &measurements() const; private: diff --git a/tests/framework/TestCase.h b/tests/framework/TestCase.h index 18dd12e442..d7bf54d2fc 100644 --- a/tests/framework/TestCase.h +++ b/tests/framework/TestCase.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -40,9 +40,13 @@ namespace framework class TestCase { public: + /** Setup the test */ virtual void do_setup() {}; + /** Run the test */ virtual void do_run() {}; + /** Sync the test */ virtual void do_sync() {}; + /** Teardown the test */ virtual void do_teardown() {}; /** Default destructor. */ @@ -54,10 +58,15 @@ protected: friend class TestCaseFactory; }; +/** Data test case class */ template class DataTestCase : public TestCase { protected: + /** Construct a data test case. + * + * @param[in] data Test data. + */ explicit DataTestCase(T data) : _data{ std::move(data) } { diff --git a/tests/framework/TestCaseFactory.h b/tests/framework/TestCaseFactory.h index b8c8cdbeb0..7164f8f3e2 100644 --- a/tests/framework/TestCaseFactory.h +++ b/tests/framework/TestCaseFactory.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -110,6 +110,7 @@ public: std::unique_ptr make() const override; }; +/** Implementation of a test case factory to create data test cases. */ template class DataTestCaseFactory final : public TestCaseFactory { diff --git a/tests/framework/TestResult.h b/tests/framework/TestResult.h index e71ef95112..cdace17047 100644 --- a/tests/framework/TestResult.h +++ b/tests/framework/TestResult.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -71,8 +71,8 @@ struct TestResult { } - Status status{ Status::NOT_RUN }; //< Execution status - Profiler::MeasurementsMap measurements{}; //< Profiling information + Status status{ Status::NOT_RUN }; /**< Execution status */ + Profiler::MeasurementsMap measurements{}; /**< Profiling information */ }; } // namespace framework } // namespace test diff --git a/tests/framework/command_line/CommonOptions.h b/tests/framework/command_line/CommonOptions.h index 2da2c99874..651316c557 100644 --- a/tests/framework/command_line/CommonOptions.h +++ b/tests/framework/command_line/CommonOptions.h @@ -40,15 +40,15 @@ enum class LogFormat; enum class LogLevel; /** Common command line options used to configure the framework - * - * The options in this object get populated when "parse()" is called on the parser used to construct it. - * The expected workflow is: - * - * CommandLineParser parser; - * CommonOptions options( parser ); - * parser.parse(argc, argv); - * if(options.log_level->value() > LogLevel::NONE) --> Use the options values - */ + * + * The options in this object get populated when "parse()" is called on the parser used to construct it. + * The expected workflow is: + * + * CommandLineParser parser; + * CommonOptions options( parser ); + * parser.parse(argc, argv); + * if(options.log_level->value() > LogLevel::NONE) --> Use the options values + */ class CommonOptions { public: @@ -57,7 +57,9 @@ public: * @param[in,out] parser A parser on which "parse()" hasn't been called yet. */ CommonOptions(CommandLineParser &parser); + /** Prevent instances of this class from being copy constructed */ CommonOptions(const CommonOptions &) = delete; + /** Prevent instances of this class from being copied */ CommonOptions &operator=(const CommonOptions &) = delete; /** Create the printers based on parsed command line options * @@ -67,19 +69,19 @@ public: */ std::vector> create_printers(); - ToggleOption *help; - EnumListOption *instruments; - SimpleOption *iterations; - SimpleOption *threads; - EnumOption *log_format; - SimpleOption *log_file; - EnumOption *log_level; - ToggleOption *throw_errors; - ToggleOption *color_output; - ToggleOption *pretty_console; - SimpleOption *json_file; - SimpleOption *pretty_file; - std::vector> log_streams; + ToggleOption *help; /**< Show help option */ + EnumListOption *instruments; /**< Instruments option */ + SimpleOption *iterations; /**< Number of iterations option */ + SimpleOption *threads; /**< Number of threads option */ + EnumOption *log_format; /**< Log format option */ + SimpleOption *log_file; /**< Log file option */ + EnumOption *log_level; /**< Logging level option */ + ToggleOption *throw_errors; /**< Throw errors option */ + ToggleOption *color_output; /**< Color output option */ + ToggleOption *pretty_console; /**< Pretty console option */ + SimpleOption *json_file; /**< JSON output file option */ + SimpleOption *pretty_file; /**< Pretty output file option */ + std::vector> log_streams; /**< Log streams */ }; } // namespace framework diff --git a/tests/framework/command_line/EnumListOption.h b/tests/framework/command_line/EnumListOption.h index 6155a5da4c..39006d86b9 100644 --- a/tests/framework/command_line/EnumListOption.h +++ b/tests/framework/command_line/EnumListOption.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -60,7 +60,12 @@ public: EnumListOption(std::string name, std::set allowed_values, std::initializer_list &&default_values); bool parse(std::string value) override; - std::string help() const override; + std::string help() const override; + + /** Get the values of the option. + * + * @return a list of the selected option values. + */ const std::vector &value() const; private: diff --git a/tests/framework/command_line/EnumOption.h b/tests/framework/command_line/EnumOption.h index 1abba77b4b..14d61859ae 100644 --- a/tests/framework/command_line/EnumOption.h +++ b/tests/framework/command_line/EnumOption.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -59,7 +59,12 @@ public: bool parse(std::string value) override; std::string help() const override; - const T &value() const; + + /** Get the selected value. + * + * @return get the selected enum value. + */ + const T &value() const; private: std::set _allowed_values{}; diff --git a/tests/framework/command_line/ListOption.h b/tests/framework/command_line/ListOption.h index 8b1bb3d05a..07184e8e3b 100644 --- a/tests/framework/command_line/ListOption.h +++ b/tests/framework/command_line/ListOption.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -53,7 +53,12 @@ public: ListOption(std::string name, std::initializer_list &&default_values); bool parse(std::string value) override; - std::string help() const override; + std::string help() const override; + + /** Get the list of option values. + * + * @return get the list of option values. + */ const std::vector &value() const; private: diff --git a/tests/framework/command_line/SimpleOption.h b/tests/framework/command_line/SimpleOption.h index e6e8045840..d02778e781 100644 --- a/tests/framework/command_line/SimpleOption.h +++ b/tests/framework/command_line/SimpleOption.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -50,9 +50,25 @@ public: */ SimpleOption(std::string name, T default_value); + /** Parses the given string. + * + * @param[in] value String representation as passed on the command line. + * + * @return True if the value could be parsed by the specific subclass. + */ bool parse(std::string value) override; + + /** Help message for the option. + * + * @return String representing the help message for the specific subclass. + */ std::string help() const override; - const T &value() const; + + /** Get the option value. + * + * @return the option value. + */ + const T &value() const; protected: T _value{}; diff --git a/tests/framework/datasets/CartesianProductDataset.h b/tests/framework/datasets/CartesianProductDataset.h index 438a782c46..b2790d7525 100644 --- a/tests/framework/datasets/CartesianProductDataset.h +++ b/tests/framework/datasets/CartesianProductDataset.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -64,6 +64,7 @@ public: { } + /** Allow instances of this class to be move constructed */ CartesianProductDataset(CartesianProductDataset &&) = default; /** Type of the dataset. */ @@ -72,6 +73,11 @@ public: /** Iterator for the dataset. */ struct iterator { + /** Construct an iterator. + * + * @param[in] dataset1 Dataset 1. + * @param[in] dataset2 Dataset 2. + */ iterator(const T_noref *dataset1, const U_noref *dataset2) : _iter1{ dataset1->begin() }, _dataset2{ dataset2 }, @@ -79,23 +85,40 @@ public: { } + /** Allow instances of this class to be copy constructed */ iterator(const iterator &) = default; + /** Allow instances of this class to be copied */ iterator &operator=(const iterator &) = default; - iterator(iterator &&) = default; + /** Allow instances of this class to be move constructed */ + iterator(iterator &&) = default; + /** Allow instances of this class to be moved */ iterator &operator=(iterator &&) = default; + /** Default destructor */ ~iterator() = default; + /** Get the description of the current value. + * + * @return description of the current value. + */ std::string description() const { return _iter1.description() + ":" + _iter2.description(); } + /** Get the value of the iterator. + * + * @return the value of the iterator. + */ CartesianProductDataset::type operator*() const { return std::tuple_cat(*_iter1, *_iter2); } + /** Inrement the iterator. + * + * @return *this; + */ iterator &operator++() { ++_second_pos; @@ -159,6 +182,13 @@ CartesianProductDataset combine(T &&dataset1, U &&dataset2) return CartesianProductDataset(std::forward(dataset1), std::forward(dataset2)); } +/** Helper function to create a @ref CartesianProductDataset. + * + * @param[in] dataset1 First dataset. + * @param[in] dataset2 Second dataset. + * + * @return A grid dataset. + */ template CartesianProductDataset operator*(T &&dataset1, U &&dataset2) diff --git a/tests/framework/datasets/ContainerDataset.h b/tests/framework/datasets/ContainerDataset.h index 80616c46fc..8dfd2164c7 100644 --- a/tests/framework/datasets/ContainerDataset.h +++ b/tests/framework/datasets/ContainerDataset.h @@ -72,8 +72,10 @@ public: { } + /** Allow instances of this class to be copy constructed */ ContainerDataset(const ContainerDataset &) = default; - ContainerDataset(ContainerDataset &&) = default; + /** Allow instances of this class to be move constructed */ + ContainerDataset(ContainerDataset &&) = default; /** Type of the dataset. */ using type = std::tuple; @@ -81,22 +83,39 @@ public: /** Iterator for the dataset. */ struct iterator { + /** Construct iterator + * + * @param[in] name Description of the values. + * @param[in] iterator Iterator for the values. + */ iterator(std::string name, container_const_iterator iterator) : _name{ name }, _iterator{ iterator } { } + /** Get a description of the current value. + * + * @return a description. + */ std::string description() const { using support::cpp11::to_string; return _name + "=" + to_string(*_iterator); } + /** Get the current value. + * + * @return the current value. + */ ContainerDataset::type operator*() const { return std::make_tuple(*_iterator); } + /** Increment the iterator. + * + * @return this. + */ iterator &operator++() { ++_iterator; diff --git a/tests/framework/datasets/Dataset.h b/tests/framework/datasets/Dataset.h index d91673073a..5fcdc49e01 100644 --- a/tests/framework/datasets/Dataset.h +++ b/tests/framework/datasets/Dataset.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -39,10 +39,13 @@ namespace dataset class Dataset { protected: - Dataset() = default; + /** Default constructor. */ + Dataset() = default; + /** Default destructor. */ ~Dataset() = default; public: + /** Allow instances of this class to be move constructed */ Dataset(Dataset &&) = default; }; @@ -62,9 +65,11 @@ protected: { } + /** Default destructor. */ ~NamedDataset() = default; public: + /** Allow instances of this class to be move constructed */ NamedDataset(NamedDataset &&) = default; /** Return name of the dataset. diff --git a/tests/framework/datasets/InitializerListDataset.h b/tests/framework/datasets/InitializerListDataset.h index 7d32234fab..f90e0b747a 100644 --- a/tests/framework/datasets/InitializerListDataset.h +++ b/tests/framework/datasets/InitializerListDataset.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -59,6 +59,7 @@ public: { } + /** Allow instances of this class to be move constructed */ InitializerListDataset(InitializerListDataset &&) = default; /** Type of the dataset. */ @@ -67,22 +68,39 @@ public: /** Iterator for the dataset. */ struct iterator { + /** Construct an iterator for the dataset + * + * @param[in] name Name of the dataset. + * @param[in] iterator Iterator of the dataset values. + */ iterator(std::string name, data_const_iterator iterator) : _name{ name }, _iterator{ iterator } { } + /** Get a description of the current value. + * + * @return a description. + */ std::string description() const { using support::cpp11::to_string; return _name + "=" + to_string(*_iterator); } + /** Get the current value. + * + * @return the current value. + */ InitializerListDataset::type operator*() const { return std::make_tuple(*_iterator); } + /** Increment the iterator. + * + * @return *this. + */ iterator &operator++() { ++_iterator; diff --git a/tests/framework/datasets/JoinDataset.h b/tests/framework/datasets/JoinDataset.h index d682c19d6b..bf504ec3ce 100644 --- a/tests/framework/datasets/JoinDataset.h +++ b/tests/framework/datasets/JoinDataset.h @@ -64,6 +64,7 @@ public: { } + /** Allow instances of this class to be move constructed */ JoinDataset(JoinDataset &&) = default; /** Type of the dataset. */ @@ -72,21 +73,38 @@ public: /** Iterator for the dataset. */ struct iterator { + /** Construct an iterator. + * + * @param[in] dataset1 Dataset 1. + * @param[in] dataset2 Dataset 2. + */ iterator(const T_noref *dataset1, const U_noref *dataset2) : _iter1{ dataset1->begin() }, _iter2{ dataset2->begin() }, _first_size{ dataset1->size() } { } + /** Get the description of the current value. + * + * @return description of the current value. + */ std::string description() const { return _first_size > 0 ? _iter1.description() : _iter2.description(); } + /** Get the value of the iterator. + * + * @return the value of the iterator. + */ JoinDataset::type operator*() const { return _first_size > 0 ? *_iter1 : *_iter2; } + /** Inrement the iterator. + * + * @return *this; + */ iterator &operator++() { if(_first_size > 0) diff --git a/tests/framework/datasets/RangeDataset.h b/tests/framework/datasets/RangeDataset.h index 637abe0a83..a08756694a 100644 --- a/tests/framework/datasets/RangeDataset.h +++ b/tests/framework/datasets/RangeDataset.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -60,6 +60,7 @@ public: { } + /** Allow instances of this class to be move constructed */ RangeDataset(RangeDataset &&) = default; /** Type of the dataset. */ @@ -68,22 +69,40 @@ public: /** Iterator for the dataset. */ struct iterator { + /** Construct an iterator. + * + * @param[in] name Dataset name. + * @param[in] start Dataset start value. + * @param[in] step Dataset step size. + */ iterator(std::string name, T start, T step) : _name{ name }, _value{ start }, _step{ step } { } + /** Get the description of the current value. + * + * @return description of the current value. + */ std::string description() const { using support::cpp11::to_string; return _name + "=" + to_string(_value); } + /** Get the value of the iterator. + * + * @return the value of the iterator. + */ RangeDataset::type operator*() const { return std::make_tuple(_value); } + /** Inrement the iterator. + * + * @return *this; + */ iterator &operator++() { _value += _step; diff --git a/tests/framework/datasets/SingletonDataset.h b/tests/framework/datasets/SingletonDataset.h index 1acb5765e5..47a38ec6f2 100644 --- a/tests/framework/datasets/SingletonDataset.h +++ b/tests/framework/datasets/SingletonDataset.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -56,6 +56,7 @@ public: { } + /** Allow instances of this class to be move constructed */ SingletonDataset(SingletonDataset &&) = default; /** Type of the dataset. */ @@ -64,29 +65,51 @@ public: /** Iterator for the dataset. */ struct iterator { + /** Construct an iterator. + * + * @param[in] name Name of the dataset. + * @param[in] value The singleton value. + */ iterator(std::string name, const T *value) : _name{ name }, _value{ value } { } + /** Default destructor. */ ~iterator() = default; + /** Allow instances of this class to be copy constructed */ iterator(const iterator &) = default; + /** Allow instances of this class to be copied */ iterator &operator=(const iterator &) = default; - iterator(iterator &&) = default; + /** Allow instances of this class to be move constructed */ + iterator(iterator &&) = default; + /** Allow instances of this class to be moved */ iterator &operator=(iterator &&) = default; + /** Get the description of the current value. + * + * @return description of the current value. + */ std::string description() const { using support::cpp11::to_string; return _name + "=" + to_string(*_value); } + /** Get the value of the iterator. + * + * @return the value of the iterator. + */ SingletonDataset::type operator*() const { return std::make_tuple(*_value); } + /** Inrement the iterator. + * + * @return *this; + */ iterator &operator++() { return *this; diff --git a/tests/framework/datasets/ZipDataset.h b/tests/framework/datasets/ZipDataset.h index b95b7209a7..3d93b92506 100644 --- a/tests/framework/datasets/ZipDataset.h +++ b/tests/framework/datasets/ZipDataset.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -62,6 +62,7 @@ public: { } + /** Allow instances of this class to be move constructed */ ZipDataset(ZipDataset &&) = default; /** Type of the dataset. */ @@ -70,21 +71,38 @@ public: /** Iterator for the dataset. */ struct iterator { + /** Construct an iterator. + * + * @param[in] iter1 Iterator 1. + * @param[in] iter2 Iterator 2. + */ iterator(iter1_type iter1, iter2_type iter2) : _iter1{ std::move(iter1) }, _iter2{ std::move(iter2) } { } + /** Get the description of the current value. + * + * @return description of the current value. + */ std::string description() const { return _iter1.description() + ":" + _iter2.description(); } + /** Get the value of the iterator. + * + * @return the value of the iterator. + */ ZipDataset::type operator*() const { return std::tuple_cat(*_iter1, *_iter2); } + /** Inrement the iterator. + * + * @return *this; + */ iterator &operator++() { ++_iter1; diff --git a/tests/framework/instruments/Instrument.h b/tests/framework/instruments/Instrument.h index e25939a284..0df53f4210 100644 --- a/tests/framework/instruments/Instrument.h +++ b/tests/framework/instruments/Instrument.h @@ -57,13 +57,19 @@ public: template static std::unique_ptr make_instrument(); + /** Default constructor. */ Instrument() = default; + /** Allow instances of this class to be copy constructed */ Instrument(const Instrument &) = default; - Instrument(Instrument &&) = default; + /** Allow instances of this class to be move constructed */ + Instrument(Instrument &&) = default; + /** Allow instances of this class to be copied */ Instrument &operator=(const Instrument &) = default; + /** Allow instances of this class to be moved */ Instrument &operator=(Instrument &&) = default; - virtual ~Instrument() = default; + /** Default destructor. */ + virtual ~Instrument() = default; /** Identifier for the instrument */ virtual std::string id() const = 0; @@ -74,9 +80,13 @@ public: /** Stop measuring. */ virtual void stop() = 0; + /** Map of measurements */ using MeasurementsMap = std::map; - /** Return the latest measurement. */ + /** Return the latest measurement. + * + * @return the latest measurement. + */ virtual MeasurementsMap measurements() const = 0; protected: diff --git a/tests/framework/instruments/MaliCounter.h b/tests/framework/instruments/MaliCounter.h index b7c3483817..a3cc446cb2 100644 --- a/tests/framework/instruments/MaliCounter.h +++ b/tests/framework/instruments/MaliCounter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -41,10 +41,15 @@ namespace framework class MaliCounter : public Instrument { public: - /** Default constructor. */ + /** Default constructor. + * + * @param[in] scale_factor Measurement scale factor; + */ MaliCounter(ScaleFactor scale_factor); + /** Prevent instances of this class from being copy constructed */ MaliCounter(const MaliCounter &) = delete; + /** Prevent instances of this class from being copied */ MaliCounter &operator=(const MaliCounter &) = delete; /** Default destructor */ diff --git a/tests/framework/instruments/Measurement.h b/tests/framework/instruments/Measurement.h index 1beacf6cc5..5c62977b91 100644 --- a/tests/framework/instruments/Measurement.h +++ b/tests/framework/instruments/Measurement.h @@ -40,6 +40,7 @@ namespace framework /** Generic measurement that stores values as either double or long long int. */ struct Measurement { + /** Measurement value */ struct Value { /** Constructor @@ -187,6 +188,13 @@ struct Measurement } } + /** Get the relative standard deviation to a given distribution as a percentage. + * + * @param[in] variance The variance of the distribution. + * @param[in] mean The mean of the distribution. + * + * @return the relative standard deviation. + */ static double relative_standard_deviation(const Value &variance, const Value &mean) { if(variance.is_floating_point) @@ -222,6 +230,11 @@ struct Measurement /** Stream output operator to print the measurement. * * Prints value and unit. + * + * @param[out] os Output stream. + * @param[in] measurement Measurement. + * + * @return the modified output stream. */ friend inline std::ostream &operator<<(std::ostream &os, const Measurement &measurement) { diff --git a/tests/framework/instruments/OpenCLTimer.h b/tests/framework/instruments/OpenCLTimer.h index a3dc107bf8..44578782ed 100644 --- a/tests/framework/instruments/OpenCLTimer.h +++ b/tests/framework/instruments/OpenCLTimer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -42,6 +42,10 @@ namespace framework class OpenCLTimer : public Instrument { public: + /** Construct an OpenCL timer. + * + * @param[in] scale_factor Measurement scale factor. + */ OpenCLTimer(ScaleFactor scale_factor); std::string id() const override; void start() override; diff --git a/tests/framework/instruments/PMU.h b/tests/framework/instruments/PMU.h index c069a6366b..1dc41bef51 100644 --- a/tests/framework/instruments/PMU.h +++ b/tests/framework/instruments/PMU.h @@ -64,10 +64,16 @@ public: template T get_value() const; - /** Open the specified counter based on the default configuration. */ + /** Open the specified counter based on the default configuration. + * + * @param[in] config The default configuration. + */ void open(uint64_t config); - /** Open the specified configuration. */ + /** Open the specified configuration. + * + * @param[in] perf_config The specified configuration. + */ void open(const perf_event_attr &perf_config); /** Close the currently open counter. */ diff --git a/tests/framework/instruments/PMUCounter.h b/tests/framework/instruments/PMUCounter.h index e1b9433eda..0719b10864 100644 --- a/tests/framework/instruments/PMUCounter.h +++ b/tests/framework/instruments/PMUCounter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -37,6 +37,10 @@ namespace framework class PMUCounter : public Instrument { public: + /** Construct a PMU counter. + * + * @param[in] scale_factor Measurement scale factor. + */ PMUCounter(ScaleFactor scale_factor) { switch(scale_factor) diff --git a/tests/framework/instruments/SchedulerTimer.h b/tests/framework/instruments/SchedulerTimer.h index 446506ad73..ec282cc905 100644 --- a/tests/framework/instruments/SchedulerTimer.h +++ b/tests/framework/instruments/SchedulerTimer.h @@ -38,13 +38,23 @@ namespace framework class SchedulerTimer : public Instrument { public: + /** Construct a Scheduler timer. + * + * @param[in] scale_factor Measurement scale factor. + */ + SchedulerTimer(ScaleFactor scale_factor); + + /** Prevent instances of this class from being copy constructed */ SchedulerTimer(const SchedulerTimer &) = delete; + /** Prevent instances of this class from being copied */ SchedulerTimer &operator=(const SchedulerTimer &) = delete; - SchedulerTimer(ScaleFactor scale_factor); + std::string id() const override; void start() override; void stop() override; Instrument::MeasurementsMap measurements() const override; + + /** Kernel information */ struct kernel_info { Instrument::MeasurementsMap measurements{}; /**< Time it took the kernel to run */ diff --git a/tests/framework/instruments/WallClockTimer.h b/tests/framework/instruments/WallClockTimer.h index 468f4d3a8f..c9829aea12 100644 --- a/tests/framework/instruments/WallClockTimer.h +++ b/tests/framework/instruments/WallClockTimer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -38,6 +38,10 @@ namespace framework class WallClockTimer : public Instrument { public: + /** Construct a Wall clock timer. + * + * @param[in] scale_factor Measurement scale factor. + */ WallClockTimer(ScaleFactor scale_factor) { switch(scale_factor) diff --git a/tests/framework/instruments/hwc.hpp b/tests/framework/instruments/hwc.hpp index 3607ef574e..8c48e0ca45 100644 --- a/tests/framework/instruments/hwc.hpp +++ b/tests/framework/instruments/hwc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -37,6 +37,8 @@ #include #include +#ifndef DOXYGEN_SKIP_THIS + #if defined(ANDROID) || defined(__ANDROID__) /* We use _IOR_BAD/_IOW_BAD rather than _IOR/_IOW otherwise fails to compile with NDK-BUILD because of _IOC_TYPECHECK is defined, not because the paramter is invalid */ #define MALI_IOR(a, b, c) _IOR_BAD(a, b, c) @@ -387,4 +389,7 @@ static inline int mali_ioctl(int fd, T &arg) return 0; } } // namespace mali_userspace + +#endif /* DOXYGEN_SKIP_THIS */ + #endif /* ARM_COMPUTE_TEST_HWC */ diff --git a/tests/framework/instruments/hwc_names.hpp b/tests/framework/instruments/hwc_names.hpp index ffc19b56e5..cbcb0e788e 100644 --- a/tests/framework/instruments/hwc_names.hpp +++ b/tests/framework/instruments/hwc_names.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -24,6 +24,8 @@ #ifndef ARM_COMPUTE_TEST_HWC_NAMES #define ARM_COMPUTE_TEST_HWC_NAMES +#ifndef DOXYGEN_SKIP_THIS + namespace mali_userspace { enum MaliCounterBlockName @@ -3056,4 +3058,7 @@ enum NUM_PRODUCTS = sizeof(products) / sizeof(products[0]) }; } // namespace mali_userspace + +#endif /* DOXYGEN_SKIP_THIS */ + #endif /* ARM_COMPUTE_TEST_HWC_NAMES */ diff --git a/tests/framework/printers/Printer.h b/tests/framework/printers/Printer.h index cb0aa1e4c2..cbe22fb2a6 100644 --- a/tests/framework/printers/Printer.h +++ b/tests/framework/printers/Printer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -55,11 +55,16 @@ public: */ Printer(std::ostream &stream); + /** Prevent instances of this class from being copy constructed */ Printer(const Printer &) = delete; + /** Prevent instances of this class from being copied */ Printer &operator=(const Printer &) = delete; - Printer(Printer &&) = default; + /** Allow instances of this class to be move constructed */ + Printer(Printer &&) = default; + /** Allow instances of this class to be moved */ Printer &operator=(Printer &&) = default; + /** Default destructor. */ virtual ~Printer() = default; /** Print given string. -- cgit v1.2.1