- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You might use the same strategy has the people from FFTW?
http://www.fftw.org/doc/Allocating-aligned-memory-in-Fortran.html#Allocating-aligned-memory-in-Fortran
http://www.fftw.org/doc/Allocating-aligned-memory-in-Fortran.html#Allocating-aligned-memory-in-Fortran

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