- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CPU:Intel Core i7-2600
memory:4G
OS:Windows XP sp3
Compiler:Intel(R) C++ Compiler XE 12.1.7.371 [IA-32]
I use the code in vec_samples in "Tutorial: Auto-vectorization".
(path: ..\Composer XE 2011 SP1\Samples\en_US\C++\vec_samples)
when command line switch is: /O2 /QaxSSE3 /Qstd=c99, the vectorized code is SSE2.
Then I change align(16) to align(32) and add some "#pragma" directives.
when command line switch is /QxAVX, the vectorized code is still SSE2!!
So my question is "how to generate the AVX codr by auto-vectorization"?
_declspec(align(32)) FTYPE a[ROW][COLWIDTH];
_declspec(align(32)) FTYPE b[ROW];
_declspec(align(32)) FTYPE x[COLWIDTH];
void matvec(int size1, int size2, FTYPE a[][size2], FTYPE b[], FTYPE x[])
{
int i, j;
for (i = 0; i < size1; i++) {
b = 0;
#pragma simd
#pragma vector aligned
for (j = 0;j < size2; j++) {
b += a
}
}
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page