0

I want to use OpenMP with iterator pattern. But it says syntax error. Is there some way to get this run with iterator pattern? Don't want to work with indexes.

#pragma omp parallel 
{
#pragma omp for 
for (Food * thisFood : food){
...
}
}
P̲̳x͓L̳
  • 3,615
  • 3
  • 29
  • 37
Furtano
  • 375
  • 1
  • 3
  • 15
  • 2
    Not really but somehow. http://stackoverflow.com/questions/17848521/using-openmp-with-c11-range-based-for-loops – Pixelchemist Mar 24 '14 at 12:01
  • 1
    @Pixelchemist the post you mention use the task construct, and I agree that it do it! but for the `for` construct even OpenMP v4 is limited to the old C++98 feature, so the new C++11 for (iterator pattern) will not be distribute among multiple thread [read more](http://stackoverflow.com/questions/13837696/can-i-safely-use-openmp-with-c11) – alexbuisson Mar 25 '14 at 10:33
  • 1
    @alexbuisson That's what I mean by "not really". – Pixelchemist Mar 25 '14 at 15:43

0 Answers0