Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Align data

jmorgie
Beginner
362 Views

I have several large static arrays which I would like aligned on 64 byte boundaries.

static complex R[4096][2048];

static complex Q[2048][2048];

using icpc, Linux, running on Itanium2 cores.

I am guessing that there is a #pragma for this?

is there a good reference for the icpc #pragma allowed?

thanks

0 Kudos
1 Solution
TimP
Honored Contributor III
362 Views

icpc should accept the same __attribute__((aligned(16))) as g++, and also the MSVC style stuff. You could try increasing it from 16 to 64, but that may depend on binutils glibc and kernel as to whether it is actually effective. You might look up the ld ALIGN in the binutils manual, as well as references about supporting larger than default values for g++ -mpreferred-stack-boundary (default value 4 means 2^4).

16-byte alignment is sufficient for all the alignment analyses required by icpc on either ia64 or current Xeon.

View solution in original post

0 Kudos
2 Replies
TimP
Honored Contributor III
363 Views

icpc should accept the same __attribute__((aligned(16))) as g++, and also the MSVC style stuff. You could try increasing it from 16 to 64, but that may depend on binutils glibc and kernel as to whether it is actually effective. You might look up the ld ALIGN in the binutils manual, as well as references about supporting larger than default values for g++ -mpreferred-stack-boundary (default value 4 means 2^4).

16-byte alignment is sufficient for all the alignment analyses required by icpc on either ia64 or current Xeon.

0 Kudos
jmorgie
Beginner
362 Views
I had no idea this attribute thing existed. thanks
0 Kudos
Reply