code that may not be directly parallelized by OpenMP
Working on autoparallelizer and looking for benchmarks that may not be directly parallelized by OpenMP ( "directly parallelized" meaning: to create parallel executable without modifying the code, just by specifying proper OpenMP directives ).
Being on the subject, is it possible to parallelize the following code using OpenMP?
1.
double a[ARRAY_DIM], c[ARRAY_DIM];
.
double ret;
ret = 0.;
for ( i = 0; i < ARRAY_DIM; i++ ) {
c[i] = exp( ret );
ret += a[i];
}
return ret;
2.
double a[ARRAY_DIM], c[ARRAY_DIM];
.
double ret;
ret = 0.;
for ( i = 0; i < ARRAY_DIM; i++ ) {
if ( a[i] > 0.01 ) {
ret = c[i];
}
}
return ret;