Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

9.x vs 10.1.x optimization help.

Eric_B_
Beginner
350 Views

I've tried to boil this down to the simplest program I can. This vectorizes with 9.1.051, but reports "routine skipped: no vectorization candidates" with 10.1.18.

[cpp]#include 

int main (int argc, char * argv[])
{
  int count = atoi(argv[1]);
  if (count <=0) count = 1;

  float a[count];
  float b[count];

  float * restrict a_ptr = a;
  float * restrict b_ptr = b;
  float * a_stop = a + count;

  a_ptr[0] = 1.0f;
  b_ptr[0] = 2.0f;

  while (a_ptr < a_stop) *a_ptr++ *= *b_ptr++;

  std::cout << a_ptr[-count] << ";" << b_ptr[-count] << std::endl;

  return 0;
}[/cpp]

using:

/share/apps/intel/cce/9.1.051/bin/icpc -o test test.cpp -O3 -xP -vec-report3 -restrict -std=c99 -ansi-alias

test.cpp(18) : (col. 2) remark: LOOP WAS VECTORIZED.

/share/apps/intel/cce/10.1.018/bin/icpc -o test test.cpp -vec-report3 -ip -restrict -std=c99 -ansi-alias

test.cpp(4): (col. 1) remark: routine skipped: no vectorization candidates.

Any suggestions? Am I missing something obvious?

Thanks,

Eric

0 Kudos
1 Solution
TimP
Honored Contributor III
350 Views

The 11.0 compiler, formerly offered at the top of this forum, and still offered at the top of the Fortran and MKL forums, appears to have restored the optimization.

View solution in original post

0 Kudos
1 Reply
TimP
Honored Contributor III
351 Views

The 11.0 compiler, formerly offered at the top of this forum, and still offered at the top of the Fortran and MKL forums, appears to have restored the optimization.

0 Kudos
Reply