Hi All,
I am a new user of pgi acelerator. I try to use openacc for a matirx multiplication, such as
…
!$ACC DATA COPYIN(D,u,v,w)
!$ACC& COPYOUT(m)
!$ACC PARALLEL LOOP
do k=1,n
do j=1,n
do i=1,n
m(i,j,k) = 0.
do l=1,n
m(i,j,k) = m(i,j,k) + D(l,i)*u(l,j,k)
$ + D(l,j)*v(i,l,k)
$ + D(l,k)*w(i,j,l)
enddo
enddo
enddo
enddo
!$ACC END PARALLEL LOOP
!$ACC END DATA
when compile the code, I obtain the following message
331, Complex loop carried dependence of ‘m’’ prevents parallelization
Loop carried reuse of ‘m’ prevents parallelization
Is it means that m(i,j,k) has been deal with reduction operation in the inner loop “do l=1,n” in the pgi compiler ? Is it NOT necessary to do :
…
tmp = 0.0
$ACC LOOP REDUCTION(+:tmp)
do l=1,n
tmp = tmp + D(l,i)*u(l,j,k)
$ + D(l,j)*v(i,l,k)
$ + D(l,k)*w(i,j,l)
enddo
m(i,j,k) = tmp
…
Thank you very much for your help