- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
[fortran]
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
[/fortran]
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.
Thanks,
Eli
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why are you zeroing out the entire array each time you are about to enter the inner loop?
If you meant to zero out some section of the array which you are about to modify, write it that way.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page