From 83792f1add07b54dcaef370a41869a7db2b6cc1d Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Sat, 26 Jul 2025 14:51:51 +0200 Subject: [PATCH] Disallow short functions definition on the same line in clang-format --- .clang-format | 1 + modules/performance/include/performance.hpp | 8 +- modules/performance/tests/perf_tests.cpp | 48 +++++++--- modules/task/include/task.hpp | 28 ++++-- modules/task/tests/task_tests.cpp | 96 ++++++++++++++----- modules/util/include/func_test_util.hpp | 8 +- modules/util/include/util.hpp | 16 +++- modules/util/src/func_test_util.cpp | 4 +- tasks/common/runners/performance.cpp | 4 +- .../example_processes/mpi/include/ops_mpi.hpp | 4 +- tasks/example_processes/mpi/src/ops_mpi.cpp | 4 +- .../example_processes/seq/include/ops_seq.hpp | 4 +- tasks/example_processes/seq/src/ops_seq.cpp | 4 +- .../tests/functional/main.cpp | 12 ++- .../tests/performance/main.cpp | 16 +++- tasks/example_threads/all/include/ops_all.hpp | 4 +- tasks/example_threads/all/src/ops_all.cpp | 4 +- tasks/example_threads/omp/include/ops_omp.hpp | 4 +- tasks/example_threads/omp/src/ops_omp.cpp | 4 +- tasks/example_threads/seq/include/ops_seq.hpp | 4 +- tasks/example_threads/seq/src/ops_seq.cpp | 4 +- tasks/example_threads/stl/include/ops_stl.hpp | 4 +- tasks/example_threads/stl/src/ops_stl.cpp | 4 +- tasks/example_threads/tbb/include/ops_tbb.hpp | 4 +- tasks/example_threads/tbb/src/ops_tbb.cpp | 4 +- .../example_threads/tests/functional/main.cpp | 12 ++- .../tests/performance/main.cpp | 16 +++- 27 files changed, 244 insertions(+), 81 deletions(-) diff --git a/.clang-format b/.clang-format index b0afc79c3..d7601961c 100644 --- a/.clang-format +++ b/.clang-format @@ -3,6 +3,7 @@ Standard: c++20 BasedOnStyle: Google ColumnLimit: 120 UseTab: Never +AllowShortFunctionsOnASingleLine: Empty QualifierAlignment: Left PointerAlignment: Right ReferenceAlignment: Right diff --git a/modules/performance/include/performance.hpp b/modules/performance/include/performance.hpp index 97e2bc108..c2fba94c9 100644 --- a/modules/performance/include/performance.hpp +++ b/modules/performance/include/performance.hpp @@ -14,7 +14,9 @@ namespace ppc::performance { -inline double DefaultTimer() { return -1.0; } +inline double DefaultTimer() { + return -1.0; +} struct PerfAttr { /// @brief Number of times the task is run for performance evaluation. @@ -96,7 +98,9 @@ class Perf { } /// @brief Retrieves the performance test results. /// @return The latest PerfResults structure. - [[nodiscard]] PerfResults GetPerfResults() const { return perf_results_; } + [[nodiscard]] PerfResults GetPerfResults() const { + return perf_results_; + } private: PerfResults perf_results_; diff --git a/modules/performance/tests/perf_tests.cpp b/modules/performance/tests/perf_tests.cpp index 573cb755f..4d9e47bc2 100644 --- a/modules/performance/tests/perf_tests.cpp +++ b/modules/performance/tests/perf_tests.cpp @@ -23,9 +23,13 @@ namespace ppc::test { template class TestPerfTask : public ppc::task::Task { public: - explicit TestPerfTask(const InType& in) { this->GetInput() = in; } + explicit TestPerfTask(const InType& in) { + this->GetInput() = in; + } - bool ValidationImpl() override { return !this->GetInput().empty(); } + bool ValidationImpl() override { + return !this->GetInput().empty(); + } bool PreProcessingImpl() override { this->GetOutput() = 0; @@ -39,7 +43,9 @@ class TestPerfTask : public ppc::task::Task { return true; } - bool PostProcessingImpl() override { return true; } + bool PostProcessingImpl() override { + return true; + } }; template @@ -203,7 +209,9 @@ class GetStringTaskTypeTest : public ::testing::TestWithParam std::ofstream(temp_path) << j->dump(); } - void TearDown() override { std::filesystem::remove(temp_path); } + void TearDown() override { + std::filesystem::remove(temp_path); + } }; TEST_P(GetStringTaskTypeTest, ReturnsExpectedString) { @@ -279,10 +287,18 @@ TEST(GetStringTaskStatusTest, HandlesEnabledAndDisabled) { class DummyTask : public Task { public: using Task::Task; - bool ValidationImpl() override { return true; } - bool PreProcessingImpl() override { return true; } - bool RunImpl() override { return true; } - bool PostProcessingImpl() override { return true; } + bool ValidationImpl() override { + return true; + } + bool PreProcessingImpl() override { + return true; + } + bool RunImpl() override { + return true; + } + bool PostProcessingImpl() override { + return true; + } }; TEST(TaskTest, GetDynamicTypeReturnsCorrectEnum) { @@ -372,10 +388,18 @@ TEST(PerfTest, GetStringParamNameTest) { TEST(TaskTest, Destructor_InvalidPipelineOrderTerminates_PartialPipeline) { { struct BadTask : Task { - bool ValidationImpl() override { return true; } - bool PreProcessingImpl() override { return true; } - bool RunImpl() override { return true; } - bool PostProcessingImpl() override { return true; } + bool ValidationImpl() override { + return true; + } + bool PreProcessingImpl() override { + return true; + } + bool RunImpl() override { + return true; + } + bool PostProcessingImpl() override { + return true; + } } task; task.Validation(); } diff --git a/modules/task/include/task.hpp b/modules/task/include/task.hpp index 41d9c79d7..7d1042530 100644 --- a/modules/task/include/task.hpp +++ b/modules/task/include/task.hpp @@ -164,31 +164,45 @@ class Task { /// @brief Returns the current testing mode. /// @return Reference to the current StateOfTesting. - StateOfTesting &GetStateOfTesting() { return state_of_testing_; } + StateOfTesting &GetStateOfTesting() { + return state_of_testing_; + } /// @brief Sets the dynamic task type. /// @param type_of_task Task type to set. - void SetTypeOfTask(TypeOfTask type_of_task) { type_of_task_ = type_of_task; } + void SetTypeOfTask(TypeOfTask type_of_task) { + type_of_task_ = type_of_task; + } /// @brief Returns the dynamic task type. /// @return Current dynamic task type. - [[nodiscard]] TypeOfTask GetDynamicTypeOfTask() const { return type_of_task_; } + [[nodiscard]] TypeOfTask GetDynamicTypeOfTask() const { + return type_of_task_; + } /// @brief Returns the current task status. /// @return Task status (enabled or disabled). - [[nodiscard]] StatusOfTask GetStatusOfTask() const { return status_of_task_; } + [[nodiscard]] StatusOfTask GetStatusOfTask() const { + return status_of_task_; + } /// @brief Returns the static task type. /// @return Static task type (default: kUnknown). - static constexpr TypeOfTask GetStaticTypeOfTask() { return TypeOfTask::kUnknown; } + static constexpr TypeOfTask GetStaticTypeOfTask() { + return TypeOfTask::kUnknown; + } /// @brief Returns a reference to the input data. /// @return Reference to the task's input data. - InType &GetInput() { return input_; } + InType &GetInput() { + return input_; + } /// @brief Returns a reference to the output data. /// @return Reference to the task's output data. - OutType &GetOutput() { return output_; } + OutType &GetOutput() { + return output_; + } /// @brief Destructor. Verifies that the pipeline was executed in the correct order. /// @note Terminates the program if the pipeline order is incorrect or incomplete. diff --git a/modules/task/tests/task_tests.cpp b/modules/task/tests/task_tests.cpp index 637db28b4..cbe5273a8 100644 --- a/modules/task/tests/task_tests.cpp +++ b/modules/task/tests/task_tests.cpp @@ -38,9 +38,13 @@ namespace ppc::test { template class TestTask : public ppc::task::Task { public: - explicit TestTask(const InType& in) { this->GetInput() = in; } + explicit TestTask(const InType& in) { + this->GetInput() = in; + } - bool ValidationImpl() override { return !this->GetInput().empty(); } + bool ValidationImpl() override { + return !this->GetInput().empty(); + } bool PreProcessingImpl() override { this->GetOutput() = 0; @@ -54,7 +58,9 @@ class TestTask : public ppc::task::Task { return true; } - bool PostProcessingImpl() override { return true; } + bool PostProcessingImpl() override { + return true; + } }; template @@ -149,9 +155,13 @@ TEST(task_tests, premature_postprocessing_after_preprocessing) { EXPECT_THROW(test_task.PostProcessing(), std::runtime_error); } -TEST(TaskTest, GetStringTaskStatus_Disabled) { EXPECT_EQ(GetStringTaskStatus(StatusOfTask::kDisabled), "disabled"); } +TEST(TaskTest, GetStringTaskStatus_Disabled) { + EXPECT_EQ(GetStringTaskStatus(StatusOfTask::kDisabled), "disabled"); +} -TEST(TaskTest, GetStringTaskStatus_Enabled) { EXPECT_EQ(GetStringTaskStatus(StatusOfTask::kEnabled), "enabled"); } +TEST(TaskTest, GetStringTaskStatus_Enabled) { + EXPECT_EQ(GetStringTaskStatus(StatusOfTask::kEnabled), "enabled"); +} TEST(TaskTest, GetStringTaskType_InvalidFileThrows) { EXPECT_THROW({ GetStringTaskType(TypeOfTask::kALL, "non_existing_file.json"); }, std::runtime_error); @@ -217,11 +227,21 @@ TEST(TaskTest, TaskDestructor_ThrowsIfStageIncomplete) { { std::vector in(20, 1); struct LocalTask : Task, int32_t> { - explicit LocalTask(const std::vector& in) { this->GetInput() = in; } - bool ValidationImpl() override { return true; } - bool PreProcessingImpl() override { return true; } - bool RunImpl() override { return true; } - bool PostProcessingImpl() override { return true; } + explicit LocalTask(const std::vector& in) { + this->GetInput() = in; + } + bool ValidationImpl() override { + return true; + } + bool PreProcessingImpl() override { + return true; + } + bool RunImpl() override { + return true; + } + bool PostProcessingImpl() override { + return true; + } } task(in); task.Validation(); } @@ -233,11 +253,21 @@ TEST(TaskTest, TaskDestructor_ThrowsIfEmpty) { { std::vector in(20, 1); struct LocalTask : Task, int32_t> { - explicit LocalTask(const std::vector& in) { this->GetInput() = in; } - bool ValidationImpl() override { return true; } - bool PreProcessingImpl() override { return true; } - bool RunImpl() override { return true; } - bool PostProcessingImpl() override { return true; } + explicit LocalTask(const std::vector& in) { + this->GetInput() = in; + } + bool ValidationImpl() override { + return true; + } + bool PreProcessingImpl() override { + return true; + } + bool RunImpl() override { + return true; + } + bool PostProcessingImpl() override { + return true; + } } task(in); } EXPECT_TRUE(ppc::util::DestructorFailureFlag::Get()); @@ -246,14 +276,22 @@ TEST(TaskTest, TaskDestructor_ThrowsIfEmpty) { TEST(TaskTest, InternalTimeTest_ThrowsIfTimeoutExceeded) { struct SlowTask : Task, int32_t> { - explicit SlowTask(const std::vector& in) { this->GetInput() = in; } - bool ValidationImpl() override { return true; } + explicit SlowTask(const std::vector& in) { + this->GetInput() = in; + } + bool ValidationImpl() override { + return true; + } bool PreProcessingImpl() override { std::this_thread::sleep_for(std::chrono::seconds(2)); return true; } - bool RunImpl() override { return true; } - bool PostProcessingImpl() override { return true; } + bool RunImpl() override { + return true; + } + bool PostProcessingImpl() override { + return true; + } }; std::vector in(20, 1); @@ -268,10 +306,18 @@ TEST(TaskTest, InternalTimeTest_ThrowsIfTimeoutExceeded) { class DummyTask : public Task { public: using Task::Task; - bool ValidationImpl() override { return true; } - bool PreProcessingImpl() override { return true; } - bool RunImpl() override { return true; } - bool PostProcessingImpl() override { return true; } + bool ValidationImpl() override { + return true; + } + bool PreProcessingImpl() override { + return true; + } + bool RunImpl() override { + return true; + } + bool PostProcessingImpl() override { + return true; + } }; TEST(TaskTest, ValidationThrowsIfCalledTwice) { @@ -297,4 +343,6 @@ TEST(TaskTest, PostProcessingThrowsIfCalledBeforeRun) { EXPECT_THROW(task->PostProcessing(), std::runtime_error); } -int main(int argc, char** argv) { return ppc::runners::SimpleInit(argc, argv); } +int main(int argc, char** argv) { + return ppc::runners::SimpleInit(argc, argv); +} diff --git a/modules/util/include/func_test_util.hpp b/modules/util/include/func_test_util.hpp index 5be35e73b..9977ca974 100644 --- a/modules/util/include/func_test_util.hpp +++ b/modules/util/include/func_test_util.hpp @@ -72,9 +72,13 @@ class BaseRunFuncTests : public ::testing::TestWithParam failure_flag{false}; @@ -79,7 +85,9 @@ std::string GetNamespace() { return (pos != std::string::npos) ? name.substr(0, pos) : std::string{}; } -inline std::shared_ptr InitJSONPtr() { return std::make_shared(); } +inline std::shared_ptr InitJSONPtr() { + return std::make_shared(); +} bool IsUnderMpirun(); diff --git a/modules/util/src/func_test_util.cpp b/modules/util/src/func_test_util.cpp index 47899659f..a5dfe0811 100644 --- a/modules/util/src/func_test_util.cpp +++ b/modules/util/src/func_test_util.cpp @@ -2,7 +2,9 @@ #include "util/include/perf_test_util.hpp" -double ppc::util::GetTimeMPI() { return MPI_Wtime(); } +double ppc::util::GetTimeMPI() { + return MPI_Wtime(); +} int ppc::util::GetMPIRank() { int rank = -1; diff --git a/tasks/common/runners/performance.cpp b/tasks/common/runners/performance.cpp index 10ee455c6..3fd54c746 100644 --- a/tasks/common/runners/performance.cpp +++ b/tasks/common/runners/performance.cpp @@ -1,3 +1,5 @@ #include "runners/include/runners.hpp" -int main(int argc, char** argv) { return ppc::runners::Init(argc, argv); } +int main(int argc, char** argv) { + return ppc::runners::Init(argc, argv); +} diff --git a/tasks/example_processes/mpi/include/ops_mpi.hpp b/tasks/example_processes/mpi/include/ops_mpi.hpp index dc128dc16..02b612af1 100644 --- a/tasks/example_processes/mpi/include/ops_mpi.hpp +++ b/tasks/example_processes/mpi/include/ops_mpi.hpp @@ -7,7 +7,9 @@ namespace nesterov_a_test_task_processes { class NesterovATestTaskMPI : public BaseTask { public: - static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { return ppc::task::TypeOfTask::kMPI; } + static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { + return ppc::task::TypeOfTask::kMPI; + } explicit NesterovATestTaskMPI(const InType &in); private: diff --git a/tasks/example_processes/mpi/src/ops_mpi.cpp b/tasks/example_processes/mpi/src/ops_mpi.cpp index d57719e7f..84cafe1f5 100644 --- a/tasks/example_processes/mpi/src/ops_mpi.cpp +++ b/tasks/example_processes/mpi/src/ops_mpi.cpp @@ -16,7 +16,9 @@ NesterovATestTaskMPI::NesterovATestTaskMPI(const InType &in) { GetOutput() = 0; } -bool NesterovATestTaskMPI::ValidationImpl() { return (GetInput() > 0) && (GetOutput() == 0); } +bool NesterovATestTaskMPI::ValidationImpl() { + return (GetInput() > 0) && (GetOutput() == 0); +} bool NesterovATestTaskMPI::PreProcessingImpl() { GetOutput() = 2 * GetInput(); diff --git a/tasks/example_processes/seq/include/ops_seq.hpp b/tasks/example_processes/seq/include/ops_seq.hpp index 0a893aa2d..6a1cdd4ce 100644 --- a/tasks/example_processes/seq/include/ops_seq.hpp +++ b/tasks/example_processes/seq/include/ops_seq.hpp @@ -7,7 +7,9 @@ namespace nesterov_a_test_task_processes { class NesterovATestTaskSEQ : public BaseTask { public: - static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { return ppc::task::TypeOfTask::kSEQ; } + static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { + return ppc::task::TypeOfTask::kSEQ; + } explicit NesterovATestTaskSEQ(const InType& in); private: diff --git a/tasks/example_processes/seq/src/ops_seq.cpp b/tasks/example_processes/seq/src/ops_seq.cpp index f45af8e76..9b0b7b582 100644 --- a/tasks/example_processes/seq/src/ops_seq.cpp +++ b/tasks/example_processes/seq/src/ops_seq.cpp @@ -14,7 +14,9 @@ NesterovATestTaskSEQ::NesterovATestTaskSEQ(const InType& in) { GetOutput() = 0; } -bool NesterovATestTaskSEQ::ValidationImpl() { return (GetInput() > 0) && (GetOutput() == 0); } +bool NesterovATestTaskSEQ::ValidationImpl() { + return (GetInput() > 0) && (GetOutput() == 0); +} bool NesterovATestTaskSEQ::PreProcessingImpl() { GetOutput() = 2 * GetInput(); diff --git a/tasks/example_processes/tests/functional/main.cpp b/tasks/example_processes/tests/functional/main.cpp index f7b1a4171..e9e43c5b2 100644 --- a/tasks/example_processes/tests/functional/main.cpp +++ b/tasks/example_processes/tests/functional/main.cpp @@ -50,9 +50,13 @@ class NesterovARunFuncTestsProcesses : public ppc::util::BaseRunFuncTests kTestParam = {std::make_tuple(3, "3"), std::make_tuple(5, "5"), std::make_tuple(7, "7")}; diff --git a/tasks/example_processes/tests/performance/main.cpp b/tasks/example_processes/tests/performance/main.cpp index 88042ab83..7946e1bf5 100644 --- a/tasks/example_processes/tests/performance/main.cpp +++ b/tasks/example_processes/tests/performance/main.cpp @@ -11,14 +11,22 @@ class ExampleRunPerfTestProcesses : public ppc::util::BaseRunPerfTests(PPC_SETTINGS_example_processes); diff --git a/tasks/example_threads/all/include/ops_all.hpp b/tasks/example_threads/all/include/ops_all.hpp index cea5c9704..c2d44989d 100644 --- a/tasks/example_threads/all/include/ops_all.hpp +++ b/tasks/example_threads/all/include/ops_all.hpp @@ -7,7 +7,9 @@ namespace nesterov_a_test_task_threads { class NesterovATestTaskALL : public BaseTask { public: - static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { return ppc::task::TypeOfTask::kALL; } + static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { + return ppc::task::TypeOfTask::kALL; + } explicit NesterovATestTaskALL(const InType &in); private: diff --git a/tasks/example_threads/all/src/ops_all.cpp b/tasks/example_threads/all/src/ops_all.cpp index 21e6024b8..92a438555 100644 --- a/tasks/example_threads/all/src/ops_all.cpp +++ b/tasks/example_threads/all/src/ops_all.cpp @@ -19,7 +19,9 @@ NesterovATestTaskALL::NesterovATestTaskALL(const InType &in) { GetOutput() = 0; } -bool NesterovATestTaskALL::ValidationImpl() { return (GetInput() > 0) && (GetOutput() == 0); } +bool NesterovATestTaskALL::ValidationImpl() { + return (GetInput() > 0) && (GetOutput() == 0); +} bool NesterovATestTaskALL::PreProcessingImpl() { GetOutput() = 2 * GetInput(); diff --git a/tasks/example_threads/omp/include/ops_omp.hpp b/tasks/example_threads/omp/include/ops_omp.hpp index 1a0dfcca0..d1075c941 100644 --- a/tasks/example_threads/omp/include/ops_omp.hpp +++ b/tasks/example_threads/omp/include/ops_omp.hpp @@ -7,7 +7,9 @@ namespace nesterov_a_test_task_threads { class NesterovATestTaskOMP : public BaseTask { public: - static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { return ppc::task::TypeOfTask::kOMP; } + static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { + return ppc::task::TypeOfTask::kOMP; + } explicit NesterovATestTaskOMP(const InType& in); private: diff --git a/tasks/example_threads/omp/src/ops_omp.cpp b/tasks/example_threads/omp/src/ops_omp.cpp index 5666df9be..3a1dca4cc 100644 --- a/tasks/example_threads/omp/src/ops_omp.cpp +++ b/tasks/example_threads/omp/src/ops_omp.cpp @@ -15,7 +15,9 @@ NesterovATestTaskOMP::NesterovATestTaskOMP(const InType& in) { GetOutput() = 0; } -bool NesterovATestTaskOMP::ValidationImpl() { return (GetInput() > 0) && (GetOutput() == 0); } +bool NesterovATestTaskOMP::ValidationImpl() { + return (GetInput() > 0) && (GetOutput() == 0); +} bool NesterovATestTaskOMP::PreProcessingImpl() { GetOutput() = 2 * GetInput(); diff --git a/tasks/example_threads/seq/include/ops_seq.hpp b/tasks/example_threads/seq/include/ops_seq.hpp index 8519b85fe..f92cd88f1 100644 --- a/tasks/example_threads/seq/include/ops_seq.hpp +++ b/tasks/example_threads/seq/include/ops_seq.hpp @@ -7,7 +7,9 @@ namespace nesterov_a_test_task_threads { class NesterovATestTaskSEQ : public BaseTask { public: - static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { return ppc::task::TypeOfTask::kSEQ; } + static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { + return ppc::task::TypeOfTask::kSEQ; + } explicit NesterovATestTaskSEQ(const InType& in); private: diff --git a/tasks/example_threads/seq/src/ops_seq.cpp b/tasks/example_threads/seq/src/ops_seq.cpp index ce3cea398..309fb4cec 100644 --- a/tasks/example_threads/seq/src/ops_seq.cpp +++ b/tasks/example_threads/seq/src/ops_seq.cpp @@ -14,7 +14,9 @@ NesterovATestTaskSEQ::NesterovATestTaskSEQ(const InType& in) { GetOutput() = 0; } -bool NesterovATestTaskSEQ::ValidationImpl() { return (GetInput() > 0) && (GetOutput() == 0); } +bool NesterovATestTaskSEQ::ValidationImpl() { + return (GetInput() > 0) && (GetOutput() == 0); +} bool NesterovATestTaskSEQ::PreProcessingImpl() { GetOutput() = 2 * GetInput(); diff --git a/tasks/example_threads/stl/include/ops_stl.hpp b/tasks/example_threads/stl/include/ops_stl.hpp index b51034298..1f38eb90e 100644 --- a/tasks/example_threads/stl/include/ops_stl.hpp +++ b/tasks/example_threads/stl/include/ops_stl.hpp @@ -7,7 +7,9 @@ namespace nesterov_a_test_task_threads { class NesterovATestTaskSTL : public BaseTask { public: - static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { return ppc::task::TypeOfTask::kSTL; } + static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { + return ppc::task::TypeOfTask::kSTL; + } explicit NesterovATestTaskSTL(const InType& in); private: diff --git a/tasks/example_threads/stl/src/ops_stl.cpp b/tasks/example_threads/stl/src/ops_stl.cpp index 45397fd6c..33fcaec2b 100644 --- a/tasks/example_threads/stl/src/ops_stl.cpp +++ b/tasks/example_threads/stl/src/ops_stl.cpp @@ -16,7 +16,9 @@ NesterovATestTaskSTL::NesterovATestTaskSTL(const InType &in) { GetOutput() = 0; } -bool NesterovATestTaskSTL::ValidationImpl() { return (GetInput() > 0) && (GetOutput() == 0); } +bool NesterovATestTaskSTL::ValidationImpl() { + return (GetInput() > 0) && (GetOutput() == 0); +} bool NesterovATestTaskSTL::PreProcessingImpl() { GetOutput() = 2 * GetInput(); diff --git a/tasks/example_threads/tbb/include/ops_tbb.hpp b/tasks/example_threads/tbb/include/ops_tbb.hpp index 0635d5935..0ec735b39 100644 --- a/tasks/example_threads/tbb/include/ops_tbb.hpp +++ b/tasks/example_threads/tbb/include/ops_tbb.hpp @@ -7,7 +7,9 @@ namespace nesterov_a_test_task_threads { class NesterovATestTaskTBB : public BaseTask { public: - static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { return ppc::task::TypeOfTask::kTBB; } + static constexpr ppc::task::TypeOfTask GetStaticTypeOfTask() { + return ppc::task::TypeOfTask::kTBB; + } explicit NesterovATestTaskTBB(const InType& in); private: diff --git a/tasks/example_threads/tbb/src/ops_tbb.cpp b/tasks/example_threads/tbb/src/ops_tbb.cpp index a392c99a9..1d606b8df 100644 --- a/tasks/example_threads/tbb/src/ops_tbb.cpp +++ b/tasks/example_threads/tbb/src/ops_tbb.cpp @@ -18,7 +18,9 @@ NesterovATestTaskTBB::NesterovATestTaskTBB(const InType &in) { GetOutput() = 0; } -bool NesterovATestTaskTBB::ValidationImpl() { return (GetInput() > 0) && (GetOutput() == 0); } +bool NesterovATestTaskTBB::ValidationImpl() { + return (GetInput() > 0) && (GetOutput() == 0); +} bool NesterovATestTaskTBB::PreProcessingImpl() { GetOutput() = 2 * GetInput(); diff --git a/tasks/example_threads/tests/functional/main.cpp b/tasks/example_threads/tests/functional/main.cpp index e34f21702..e5f7225db 100644 --- a/tasks/example_threads/tests/functional/main.cpp +++ b/tasks/example_threads/tests/functional/main.cpp @@ -53,9 +53,13 @@ class NesterovARunFuncTestsThreads : public ppc::util::BaseRunFuncTests kTestParam = {std::make_tuple(3, "3"), std::make_tuple(5, "5"), std::make_tuple(7, "7")}; diff --git a/tasks/example_threads/tests/performance/main.cpp b/tasks/example_threads/tests/performance/main.cpp index 970759c25..32d70fd25 100644 --- a/tasks/example_threads/tests/performance/main.cpp +++ b/tasks/example_threads/tests/performance/main.cpp @@ -14,14 +14,22 @@ class ExampleRunPerfTestThreads : public ppc::util::BaseRunPerfTests