When I compiled the code with OpenACC,I got the error information:[if not already present]
#include<iostream>
#include<openacc.h>
using namespace std;
int main(){
int i,j,sum=0;
#pragma acc parallel loop copyin(i,j) copyout(sum)
for(int i=0;i<100;i++){
#pragma acc loop
for(int j=0;j<200;j++){
sum=i+j;
}
}
cout<<sum<<endl;
}
Result shows:
main:
8, Generating copyin(i) [if not already present] Generating copyout(sum) [if not already present] Generating copyin(j) [if not already present] Generating NVIDIA GPU code 10, #pragma acc loop gang, vector(96) /* blockIdx.x >threadIdx.x */ 12, #pragma acc loop seq 13, Accelerator restriction: induction variable live-out from loop: sum
I don't quite understand why the error shows induction variable live-out from loop: sum.