File tree 4 files changed +13
-12
lines changed
4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ Checks: >
20
20
-misc-unused-parameters,
21
21
-misc-use-anonymous-namespace,
22
22
-modernize-avoid-c-arrays,
23
+ -modernize-loop-convert,
23
24
-modernize-use-nodiscard,
24
25
-modernize-use-trailing-return-type,
25
26
-readability-function-cognitive-complexity,
Original file line number Diff line number Diff line change @@ -27,10 +27,10 @@ struct PerfResults {
27
27
class Perf {
28
28
public:
29
29
// Init performance analysis with initialized task and initialized data
30
- explicit Perf (const std::shared_ptr<Task>& task );
30
+ explicit Perf (const std::shared_ptr<Task>& task_ptr );
31
31
// Set task with initialized task and initialized data for performance
32
32
// analysis c
33
- void SetTask (const std::shared_ptr<Task>& task );
33
+ void SetTask (const std::shared_ptr<Task>& task_ptr );
34
34
// Check performance of full task's pipeline: pre_processing() ->
35
35
// validation() -> run() -> post_processing()
36
36
void PipelineRun (const std::shared_ptr<PerfAttr>& perf_attr,
Original file line number Diff line number Diff line change 7
7
#include < sstream>
8
8
#include < utility>
9
9
10
- ppc::core::Perf::Perf (const std::shared_ptr<Task>& task ) { SetTask (task ); }
10
+ ppc::core::Perf::Perf (const std::shared_ptr<Task>& task_ptr ) { SetTask (task_ptr ); }
11
11
12
- void ppc::core::Perf::SetTask (const std::shared_ptr<Task>& task ) {
13
- task ->get_data ()->state_of_testing = TaskData::StateOfTesting::PERF;
14
- this ->task = task ;
12
+ void ppc::core::Perf::SetTask (const std::shared_ptr<Task>& task_ptr ) {
13
+ task_ptr ->get_data ()->state_of_testing = TaskData::StateOfTesting::PERF;
14
+ this ->task = task_ptr ;
15
15
}
16
16
17
17
void ppc::core::Perf::PipelineRun (const std::shared_ptr<PerfAttr>& perf_attr,
Original file line number Diff line number Diff line change @@ -63,18 +63,18 @@ bool nesterov_a_test_task_omp::TestOMPTaskParallel::run_impl() {
63
63
auto temp_res = res;
64
64
if (ops == " +" ) {
65
65
#pragma omp parallel for reduction(+ : temp_res)
66
- for (int i : input_) {
67
- temp_res += i ;
66
+ for (int i = 0 ; i < static_cast < int >( input_. size ()); i++ ) {
67
+ temp_res += input_[i] ;
68
68
}
69
69
} else if (ops == " -" ) {
70
70
#pragma omp parallel for reduction(- : temp_res)
71
- for (int i : input_) {
72
- temp_res -= i ;
71
+ for (int i = 0 ; i < static_cast < int >( input_. size ()); i++ ) {
72
+ temp_res -= input_[i] ;
73
73
}
74
74
} else if (ops == " *" ) {
75
75
#pragma omp parallel for reduction(* : temp_res)
76
- for (int i : input_) {
77
- temp_res *= i ;
76
+ for (int i = 0 ; i < static_cast < int >( input_. size ()); i++ ) {
77
+ temp_res *= input_[i] ;
78
78
}
79
79
}
80
80
res = temp_res;
You can’t perform that action at this time.
0 commit comments