Hi,
I’m working on an application using OpenMP offloading with nvc++. In particular, I’m using the target teams distribute parallel for and haven’t had any issues. However, I wanted to test the descriptive approach of using target teams loop but I’m getting a compilation error: Unknown variable reference. This is the code section I’m having issues with, specifically, line 449.
442 #pragma omp target enter data map(to:coils[0:size_3D],e_r[0:size_3D],leng_segment[0:size_2D],particles[0:size_particles])
443
444 #pragma omp parallel num_threads(2)
445 {
446 #pragma omp single
447 {
448 for (int i = 1; i <= steps; i++){
449 #pragma omp target teams distribute parallel for (COMMENT: alternatively target teams loop)
450 for(int p=0; p < particle_count ; p++){
451 int base = p*DIMENSIONS;
452 if((particles[base] == MINOR_RADIUS) && (particles[base+1] == MINOR_RADIUS) && (particles[base+2] == MINOR_RADIUS)){
453 continue;
454 }
455 else{
456 diverged = computeIteration(coils,e_r,leng_segment,&particles[base],step_size,mode,divergenceCounter);
457 }
458 }
459
460 if(i%10 == 0){
461 #pragma omp taskwait
462 #pragma omp target update from(particles[0:size_particles])
463 {
464 #pragma omp task shared(particles) firstprivate(i,output,size_particles)
465 printIterationFile(particles, i, output,particle_count);
466 }
467 }
468 }
469 }
470 }
471 #pragma omp target exit data map(release:coils[0:size_3D],e_r[0:size_3D],leng_segment[0:size_2D],particles[0:size_particles])
I’m using nvc++ 22.5-0 (NVHPCSDK 22.5), and I’m compiling with -mp=gpu -gpu=pinned,fastmath -Minfo=mp
Am I doing something wrong when changing from target teams distribute parallel for to target teams loop?
I’d appreciate any help.