Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Alignment of allocated arrays

Mick_Pont
Beginner
411 Views
I've been looking for an ifort compiler switch to turn on alignment of allocated arrays. In particular, I'd like my arrays to be aligned on 16 byte boundaries, to avoid problems where different code paths are taken to use SSE instructions depending on whether the array is aligned nicely or not.

I can make allocated arrays be aligned by using directives like this:

Real, Allocatable :: frog(:), toad(:), newt(:)
!DEC$ ATTRIBUTES ALIGN : 16 :: frog, toad, newt

but to avoid having to do this in many places it would be simpler to use a command line switch. Is there one? I'd hoped that -align would do it, but it doesn't, and nothing else I've tried worked. I'm using a 32-bit 12.1 compiler on Windows and Linux (as far as I can tell, the 64-bit compiler always does 16-byte aligned allocation by default).

Mick
0 Kudos
2 Replies
TimP
Honored Contributor III
411 Views
I've heard that the 13.0 compiler would introduce such a switch. I don't know how popular 32-bit Windows will be in the future, with the hoped for increase in usage of AVX, which has more need of 32-byte alignment.
0 Kudos
rreis
New Contributor I
411 Views
0 Kudos
Reply