OpenMP vectorization: #pragma vector aligned ignored if schedule with chunksize is set?

  c++, icc, openmp, simd, vectorization

I have a question regarding **#pragma vector aligned**.
My understanding is, that whatever follows, it is my duty too ensure that the vector data is aligned.
Now, one possible way to exploit is the following snippet: Every thread gets blocks of size chunkSize and chunkSize is a multiple of my alignment (and also matVecDim is). Hence, all operations are aligned.

int offset = offsetCol * matVecDim;
int chunkSize = alignedCHUNKSIZE;

#pragma omp for simd nowait schedule(static, chunkSize)
#pragma vector aligned
for (int i = 0; i < matVecDim; ++i) {
    matVec[offset+ i] *= factor;
}

However, looking at the vectorization report tells me, that the intel compiler is ignoring it. Can anybody enlighten me?


Here’s the vectorization report:

remark #15389: vectorization support: reference matVec[offset+i] has unaligned access

remark #15389: vectorization support: reference matVec[offset+i] has unaligned access

remark #15381: vectorization support: unaligned access used inside loop body

remark #15305: vectorization support: vector length 4

remark #15399: vectorization support: unroll factor set to 4

remark #15309: vectorization support: normalized vectorization overhead 0.118

remark #15301: OpenMP SIMD LOOP WAS VECTORIZED

remark #15450: unmasked unaligned unit stride loads: 1

remark #15451: unmasked unaligned unit stride stores: 1

remark #15475: — begin vector cost summary —

remark #15476: scalar cost: 7

remark #15477: vector cost: 4.750

remark #15478: estimated potential speedup: 1.430

remark #15488: — end vector cost summary —

Source: Windows Questions C++

LEAVE A COMMENT