Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Diagnostic 15398: loop was not vectorized: loop was transformed to memset or memcpy

$
0
0

Cause

Below is a code snippet which generates this diagnostic. Here since the same constant value is assigned all the locations in the given array, it is more efficient to replace this operation with a memset which the compiler automatically does for us. 

Example:
 

#include<iostream>
#define N 25
int main(){
int a[N], i;
for(int i = 0; i < N; i++)
        a[i] = 0;
int sum = __sec_reduce_add(a[:]);
return 0;
}


$ icpc example6.cc -vec-report2
example6.cc(5): (col. 1) remark: loop was not vectorized: loop was transformed to memset or memcpy


Viewing all articles
Browse latest Browse all 3384

Trending Articles



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