Diagnostic 15015: loop was not vectorized: unsupported data type

Cause:

The loop has an assignment statement which assigns one struct variable to another one. But the assignment operator is not defined inside the structure such that there is a transilation of this struct assignment in terms of scalars. Below is an example for this scenario. 


Example:

struct char4 {
  char c1;
  char c2;
 char c3;
  char c4;
};
 
extern struct char4 *a;
void vecmsg_testcore003 ()
{
  int i;
  const struct char4 n = {0, 0, 0, 0};
#pragma omp simd
  for(i = 0; i < 1024; i++) {
      a[i] = n;
  }
}


>icl -c -Qvec-report2 example4.cpp 

example4.cpp(7): (col. 5) remark: loop was not vectorized: existence of vector dependence

Resolution Status:

Provide the struct assignment operator in terms of scalars as follows:

inline char4 operator=(const char4 &x){
char4 temp;
temp.c1 = x.c1;
temp.c2 = x.c2;
temp.c3 = x.c3;
temp.c4 = x.c4;
return temp;
}

For more complete information about compiler optimizations, see our Optimization Notice.