Hello,
I have just recently begun experimenting with ICC 17 and its auto-vectorization features. I was wondering if anyone could explain why the following code ('blah') can be auto-vectorized by ICC while ('blahblah') cannot ? The difference being that variables a,b,c are declared on the stack in 'blahblah'.
const int numElems = 256; void blah(double a[], double b[], double c[]) { int i = 0; // This vectorizes for (i = 0; i < numElems; i++) { a[i] = b[i] * c[i]; } } void blahblah() { double a[numElems]; double b[numElems]; double c[numElems]; int i = 0; // This does not vectorize for (i = 0; i < numElems; i++) { a[i] = b[i] * c[i]; } }
Thanks in advance for any help.
Thread Topic:
Question