File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -63,18 +63,18 @@ bool nesterov_a_test_task_omp::TestOMPTaskParallel::run_impl() {
6363 auto temp_res = res;
6464 if (ops == " +" ) {
6565#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] ;
6868 }
6969 } else if (ops == " -" ) {
7070#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] ;
7373 }
7474 } else if (ops == " *" ) {
7575#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] ;
7878 }
7979 }
8080 res = temp_res;
You can’t perform that action at this time.
0 commit comments