Understanding the collapse clause in openmp

前端 未结 2 364
遥遥无期
遥遥无期 2020-11-30 04:44

I came across an OpenMP code that had the collapse clause, which was new to me. I\'m trying to understand what it means, but I don\'t think I have fully grasped it\'s implic

2条回答
  •  孤城傲影
    2020-11-30 05:11

    If your purpose is balancing the load over increasing rows, assuming the workload for each item is regular or well scattered, then how about folding the row indices in half, and forgetting about the collapse clause?

    #pragma omp for
    for (int iy0=0; iy0= n/2) iy = n-1 -iy0 +n/2;
      for (int ix=iy+1; ix

提交回复
热议问题