Page 1 of 1

collapsing not nested loops

Posted: Fri Jan 25, 2008 6:05 am
by dmikh
From the Draft (section 2.5.1) it may be not clear whether only nested loops can be associated in a loop construct by collapse clause. For example, will the following code be conforming and iterations of these two adjacent loops will be collapsed into one iteration space?

Code: Select all

  #pragma omp for collapse(2)
  for (i=1; i<10; i++)
  for (j=1; j<10; j++)

Re: collapsing not nested loops

Posted: Tue Jan 29, 2008 3:50 pm
by lfm
I think that it is clear in the draft. p.39 line 16 says "The loop construct is associated with a loop nest consisting of one or more loops that follow the directive."