Question: Convert the following OpenMP program to run in parallel using C++ 11 Threads (e.g, using the future class.) Try to make your code run the

 Convert the following OpenMP program to run in parallel using C++

Convert the following OpenMP program to run in parallel using C++ 11 Threads (e.g, using the future class.) Try to make your code run the same way as the OpenMP code does. // This code finds the maximum value of a polynomial over a range #include using namespace std; int poly(int x){ return x*x*x - x*x +10*x-7; } int max_over_range(int a, int b) { int max_val=0; #pragma omp parallel for reduction(max:max_val) for (int i = a; i max_val) { max_val= c; } } return max_val; } int main() { cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!