Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Align data

jmorgie
Beginner
199 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
Black Belt
199 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

2 Replies
TimP
Black Belt
200 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.

jmorgie
Beginner
199 Views
I had no idea this attribute thing existed. thanks
Reply