c++ ppl.h for parallel_for in linux

2.6k Views Asked by At

I made project in windows using c++ and now I am trying to build my project in linux(ubunt). However, I couldn't find ppl.h in linux. I used a lot of parallel_for in my project.

What is the replacement can I use?

1

There are 1 best solutions below

0
Victor Gubin On

Parallel Patterns Library is Windows only. It is not useful for portable application, it is considered that OpenMP is best alternative for PPL. I.e. for the parallel for you can use following:

#ifdef _OPENMP
#pragma omp parallel for
#endif // _OPENMP
for(std::size_t i=0; i < foo; i++) {
  bar[i] = (baz[i] * quux[i]);
}

To enable OpenMP add -fopenmp flag for G++.

PS.