forked from learning-process/parallel_programming_course
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (34 loc) · 1.39 KB
/
main.cpp
File metadata and controls
48 lines (34 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <gtest/gtest.h>
#include "example_threads/all/include/ops_all.hpp"
#include "example_threads/common/include/common.hpp"
#include "example_threads/omp/include/ops_omp.hpp"
#include "example_threads/seq/include/ops_seq.hpp"
#include "example_threads/stl/include/ops_stl.hpp"
#include "example_threads/tbb/include/ops_tbb.hpp"
#include "util/include/perf_test_util.hpp"
namespace nesterov_a_test_task_threads {
class ExampleRunPerfTestThreads : public ppc::util::BaseRunPerfTests<InType, OutType> {
const int kCount_ = 200;
InType input_data_{};
void SetUp() override {
input_data_ = kCount_;
}
bool CheckTestOutputData(OutType &output_data) final {
return input_data_ == output_data;
}
InType GetTestInputData() final {
return input_data_;
}
};
TEST_P(ExampleRunPerfTestThreads, RunPerfModes) {
ExecuteTest(GetParam());
}
namespace {
const auto kAllPerfTasks =
ppc::util::MakeAllPerfTasks<InType, NesterovATestTaskALL, NesterovATestTaskOMP, NesterovATestTaskSEQ,
NesterovATestTaskSTL, NesterovATestTaskTBB>(PPC_SETTINGS_example_threads);
const auto kGtestValues = ppc::util::TupleToGTestValues(kAllPerfTasks);
const auto kPerfTestName = ExampleRunPerfTestThreads::CustomPerfTestName;
INSTANTIATE_TEST_SUITE_P(RunModeTests, ExampleRunPerfTestThreads, kGtestValues, kPerfTestName);
} // namespace
} // namespace nesterov_a_test_task_threads