Quantcast
Viewing latest article 1
Browse Latest Browse All 21

loop is not vectorized

Hi,

I am experimenting with the auto vectorization functionality of Intel compiler. However, the following loop cannot be vectorized.

for (k=0; k < nz; k++) {

for (j=0; j < ny; j++) {

#pragma ivdep

for (i=0; i < nx; i++) {

ptr = i + j*nx + k*nx*ny;

p[ptr] = 1.0f + 0.1*drand48();

q[ptr] = 1.0f + 0.1*drand48();

}

}

}

In the program, both p and q are float arrays. The message I got for the loop from using -vec-report3 is:

remark: loop was not vectorized: existence of vector dependence

However, I cannot see any dependency in the loop. On the other hand, the loop can be vectorized if I don't use the random generator. So is it safe to say that loops with random generators cannot be vectorized?


Viewing latest article 1
Browse Latest Browse All 21

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>