I want to use the reduction clause to parallelize something like this:
- Code: Select all
#pragma parallel for ... reduction(+: sum_1, sum_2, ..., sum_100)
for(i=0; i<N; i++)
and I know the variables sum_i have to be scalars.
Does I have to write down each "if(proposition_i) sum_i ++ "" or is there a better way to do this?