How does OpenMP handle nested loops?

后端 未结 3 1025
温柔的废话
温柔的废话 2020-11-30 03:02

Does the following code just parallelize the first (outer) loops, or it parallelize the entire nested loops?

    #pragma omp parallel for
    for (int i=0;i&         


        
3条回答
  •  独厮守ぢ
    2020-11-30 03:52

    OpenMP only parallelizes the loop next to the pragma. You can parallelize the inner loop too if you want to but it won't be done automatically.

提交回复
热议问题