Why is class member variable x not allowed to be shared(x) in OpenMP?

后端 未结 2 701
刺人心
刺人心 2021-01-17 18:24

In a member function, I can parallelize using the shared member variable int *x like this

#pragma omp parallel for default(shared)
for(int i=0;i         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 18:50

    Don't know precisiely - but take a look through 32 OpenMP traps for C++ developers for sorting out most OpenMP problems

提交回复
热议问题