for (int i = 0; i < x_res; i++){
#pragma omp parallel for
for (int j = 0; j < y_res; j++) {
Ray hit = s.kd_tree->intersect(rays[i][j]);
}
}
为什么这段代码不能并行工作?我找不到原因。
回溯输出:
#0 0x00007fff8ce03bf2 in __psynch_mutexwait ()
#1 0x00007fff8cd331a1 in pthread_mutex_lock ()
#2 0x00000001000027e4 in gomp_barrier_destroy ()
#3 0x000000010000247b in gomp_team_end ()