Hi, I am trying to understand better the data dependence and "subscript too complex" rules on vectorization. Here is an example of what I don't understand:
do i=1,ni do j=1,nj zz = 0.d0 !DIR$ IVDEP do k=1,nk !!zz(k)=zz(k)+ arr(k,j,i) ! vectorizes along with line below !! zz(k)=zz(k)+ arr(k,j-1,i) ! vectorizes along with line above zz(k)=zz(k)+ arr(k,j,i)+ arr(k,j-1,i) !subscript too complex end do end do end do
I found that (under ifort 2012 -O2) the line involving zz gives the subscript too complex error. If I swap this for the commented lines, they vectorize. Can someone explain what I am not grasping? The array arr is allocatable.