- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, everyone!
I'm looking for a directive that can tell the compiler to perform "loop blocking" automatically. With -O3 option, the compiler is able to block some simple loops, e.g. the triple loop in a matrix matrix multiplication. However, the compiler may be "puzzled" by more complicated loop structures (DO loop only). Is there any directives can help the compiler to block the loops (DO-loop is enough for my work)?
Thank you in advance!
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you provide an example and describe the problem in additional detail.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
for example, a simple matrix matrix multiplication is
do j=1, n
do k=1, n
do i=1, n
c(i,j) = c(i,j) + a(i,k)*b(k,j)
enddo
enddo
enddo
ifort -O3 can do loop blocking automatically.
But, "ifort -O3" fails to block the loops for the follow code.
do j=1, n
do k=1, n
temp=b(k,j) ! temp in register
do i=1, n
c(i,j) = c(i,j) + a(i,k)*t
enddo
enddo
enddo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This example raises the possibility that you mean introduction of an undefined variable suppresses optimization. That should not be surprising.
If you mean you're interested in the directives !dir$ unroll_and_jam or !dir$ simd private, please refer to the ifort documentation, then present a clearer example of your intent.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page