@@ -114,7 +114,7 @@ template <typename InType, typename OutType>
114114double RunTaskForBenchmark (const ppc::task::TaskPtr<InType, OutType> &task) {
115115 const auto task_type = task->GetDynamicTypeOfTask ();
116116 const auto timer = MakeTechnologyTimer (task_type);
117- task->GetStateOfTesting () = ppc::task::StateOfTesting::kPerf ;
117+ task->SetStateOfTesting ( ppc::task::StateOfTesting::kPerf ) ;
118118
119119 task->Validation ();
120120 task->PreProcessing ();
@@ -137,7 +137,8 @@ void RunBenchmarkBody(const TaskGetter &task_getter, const InType &input_data, c
137137 auto task = task_getter (input_data);
138138 const double elapsed = RunTaskForBenchmark (task);
139139 state.SetIterationTime (elapsed);
140- benchmark::DoNotOptimize (task->GetOutput ());
140+ auto output = task->GetOutput ();
141+ benchmark::DoNotOptimize (output);
141142 }
142143 } catch (const std::exception &e) {
143144 PerformanceFailureFlag::Set ();
@@ -169,8 +170,13 @@ class BenchmarkTaskBody final {
169170} // namespace detail
170171
171172template <typename InType, typename OutType>
172- using PerfTestParam = std::tuple<std::function<ppc::task::TaskPtr<InType, OutType>(InType)>, std::string,
173- ppc::task::TaskCategory, ppc::task::TaskDescriptor>;
173+ struct PerfTestCase {
174+ std::function<ppc::task::TaskPtr<InType, OutType>(InType)> task_getter;
175+ ppc::task::TaskDescriptor descriptor;
176+ };
177+
178+ template <typename InType, typename OutType>
179+ using PerfTestParam = PerfTestCase<InType, OutType>;
174180
175181template <typename InType, typename OutType>
176182// / @brief Base class for performance testing of parallel tasks.
@@ -180,11 +186,11 @@ class BaseRunPerfTests : public ::testing::TestWithParam<PerfTestParam<InType, O
180186 public:
181187 // / @brief Generates a readable name for the performance test case.
182188 static std::string CustomPerfTestName (const ::testing::TestParamInfo<PerfTestParam<InType, OutType>> &info) {
183- return GetTaskDescriptor ( info.param ) .display_name ;
189+ return info.param . descriptor .display_name ;
184190 }
185191
186192 protected:
187- virtual bool CheckTestOutputData (OutType &output_data) = 0;
193+ virtual bool CheckTestOutputData (const OutType &output_data) = 0;
188194 // / @brief Supplies input data for performance testing.
189195 virtual InType GetTestInputData () = 0;
190196
@@ -193,8 +199,8 @@ class BaseRunPerfTests : public ::testing::TestWithParam<PerfTestParam<InType, O
193199 }
194200
195201 void ExecuteTest (const PerfTestParam<InType, OutType> &perf_test_param) {
196- auto task_getter = std::get< static_cast <std:: size_t >(GTestParamIndex:: kTaskGetter )>( perf_test_param) ;
197- const auto &descriptor = GetTaskDescriptor ( perf_test_param) ;
202+ auto task_getter = perf_test_param. task_getter ;
203+ const auto &descriptor = perf_test_param. descriptor ;
198204
199205 ASSERT_NE (descriptor.type , ppc::task::TypeOfTask::kUnknown );
200206 if (descriptor.status == ppc::task::StatusOfTask::kDisabled ) {
@@ -209,12 +215,11 @@ class BaseRunPerfTests : public ::testing::TestWithParam<PerfTestParam<InType, O
209215
210216 const auto input_data = GetTestInputData ();
211217 task_ = task_getter (input_data);
212- task_->GetStateOfTesting () = ppc::task::StateOfTesting::kPerf ;
218+ task_->SetStateOfTesting ( ppc::task::StateOfTesting::kPerf ) ;
213219 SynchronizeMpiRanks ();
214220 detail::RunTaskForValidation (task_);
215221
216- OutType output_data = task_->GetOutput ();
217- ASSERT_TRUE (CheckTestOutputData (output_data));
222+ ASSERT_TRUE (CheckTestOutputData (task_->GetOutput ()));
218223
219224 PerfAttr perf_attr;
220225 SetPerfAttributes (perf_attr);
@@ -236,11 +241,11 @@ class BaseRunPerfTests : public ::testing::TestWithParam<PerfTestParam<InType, O
236241
237242template <typename TaskType, typename InputType>
238243auto MakePerfTaskTuples (const std::string &settings_path, std::string_view settings_task_path = {}) {
239- const auto descriptor =
240- MakeTaskDescriptor (GetNamespace<TaskType>(), TaskType::GetStaticTypeOfTask (), settings_path, settings_task_path);
244+ const auto descriptor = MakeTaskDescriptor (ResolveTaskIdentifier<TaskType>(settings_path),
245+ TaskType::GetStaticTypeOfTask (), settings_path, settings_task_path);
241246
242- return std::make_tuple (std::make_tuple (ppc::task::TaskGetter<TaskType, InputType>, descriptor. display_name ,
243- descriptor. category , descriptor) );
247+ return std::make_tuple (
248+ PerfTestCase<InputType, typename TaskType::OutputType>{ppc::task::TaskGetter<TaskType, InputType> , descriptor} );
244249}
245250
246251template <typename Tuple, std::size_t ... I>
0 commit comments