0

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?

kangfox
  • 133
  • 1
  • 1
  • 8

1 Answers1

1

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.

Victor Gubin
  • 2,374
  • 7
  • 18