@@ -79,11 +79,16 @@ class BaseRunPerfTests : public ::testing::TestWithParam<PerfTestParam<InType, O
7979 throw std::runtime_error (err_msg.str ().c_str ());
8080 }
8181
82+ #ifndef PPC_ASAN_RUN
8283 int rank = -1 ;
8384 MPI_Comm_rank (MPI_COMM_WORLD , &rank);
8485 if (rank == 0 ) {
8586 perf.PrintPerfStatistic (test_name);
8687 }
88+ #else
89+ perf.PrintPerfStatistic (test_name);
90+ #endif
91+
8792 OutType output_data = task_->GetOutput ();
8893 ASSERT_TRUE (CheckTestOutputData (output_data));
8994 }
@@ -92,14 +97,42 @@ class BaseRunPerfTests : public ::testing::TestWithParam<PerfTestParam<InType, O
9297 ppc::core::TaskPtr<InType, OutType> task_;
9398};
9499
95- #define ADD_PERF_TASK (TaskType, InputTypeParam ) \
96- std::make_tuple (ppc::core::TaskGetter<TaskType, InputTypeParam>, \
97- std::string (ppc::util::GetNamespace<TaskType>()) + std::string(" _" ) + \
98- ppc::core::GetStringTaskType(TaskType::GetStaticTypeOfTask(), PPC_STUDENT_SETTINGS), \
99- ppc::core::PerfResults::TypeOfRunning::kPipeline), \
100- std::make_tuple(ppc::core::TaskGetter<TaskType, InputTypeParam>, \
101- std::string (ppc::util::GetNamespace<TaskType>()) + std::string(" _" ) + \
102- ppc::core::GetStringTaskType(TaskType::GetStaticTypeOfTask(), PPC_STUDENT_SETTINGS), \
103- ppc::core::PerfResults::TypeOfRunning::kTaskRun)
100+ #define ADD_PERF_TASK_THREADS (TaskType, InputTypeParam, SettingsPath ) \
101+ std::tuple ( \
102+ std::make_tuple (ppc::core::TaskGetter<TaskType, InputTypeParam>, \
103+ std::string (ppc::util::GetNamespace<TaskType>()) + "_" + \
104+ ppc::core::GetStringTaskType(TaskType::GetStaticTypeOfTask(), SettingsPath), \
105+ ppc::core::PerfResults::TypeOfRunning::kPipeline), \
106+ std::make_tuple(ppc::core::TaskGetter<TaskType, InputTypeParam>, \
107+ std::string (ppc::util::GetNamespace<TaskType>()) + "_" + \
108+ ppc::core::GetStringTaskType(TaskType::GetStaticTypeOfTask(), SettingsPath), \
109+ ppc::core::PerfResults::TypeOfRunning::kTaskRun))
110+
111+ template <typename Tuple, std::size_t... I>
112+ auto TupleToGTestValuesImpl(Tuple&& tup, std::index_sequence<I...>) {
113+ return ::testing::Values (std::get<I>(std::forward<Tuple>(tup))...);
114+ }
115+
116+ template <typename Tuple>
117+ auto TupleToGTestValues (Tuple&& tup) {
118+ constexpr size_t size = std::tuple_size<std::decay_t <Tuple>>::value;
119+ return TupleToGTestValuesImpl (std::forward<Tuple>(tup), std::make_index_sequence<size>{});
120+ }
121+
122+ #ifndef PPC_ASAN_RUN
123+ #define ADD_PERF_TASK_PROCESS (TaskType, InputTypeParam, SettingsPath ) \
124+ std::tuple ( \
125+ std::make_tuple (ppc::core::TaskGetter<TaskType, InputTypeParam>, \
126+ std::string (ppc::util::GetNamespace<TaskType>()) + "_" + \
127+ ppc::core::GetStringTaskType(TaskType::GetStaticTypeOfTask(), SettingsPath), \
128+ ppc::core::PerfResults::TypeOfRunning::kPipeline), \
129+ std::make_tuple(ppc::core::TaskGetter<TaskType, InputTypeParam>, \
130+ std::string (ppc::util::GetNamespace<TaskType>()) + "_" + \
131+ ppc::core::GetStringTaskType(TaskType::GetStaticTypeOfTask(), SettingsPath), \
132+ ppc::core::PerfResults::TypeOfRunning::kTaskRun))
133+ #else
134+ #define ADD_PERF_TASK_PROCESS (TaskType, InputTypeParam, SettingsPath ) std::make_tuple()
135+ #endif
136+
104137
105138} // namespace ppc::util
0 commit comments