directive for loop blocking?

directive for loop blocking?

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!

CPU: Intel Core 2 Duo 2.4 GHz OS: Mac OS X 10.5.8 Linux: Debian 5.0 x86_64 Compiler: Intel Fortran Compiler 11.1 & Intel C++ Compiler 11.1 (with Intel MKL included)
4 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Can you provide an example and describe the problem in additional detail.

Jim Dempsey

www.quickthreadprogramming.com

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

CPU: Intel Core 2 Duo 2.4 GHz OS: Mac OS X 10.5.8 Linux: Debian 5.0 x86_64 Compiler: Intel Fortran Compiler 11.1 & Intel C++ Compiler 11.1 (with Intel MKL included)

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.

Accedere per lasciare un commento.