Skip to main content
. 2020 Nov 13;20(22):6494. doi: 10.3390/s20226494
Algorithm 3. Calculate the dot product of two one-dimensional vectors of size 200. The function prod was vectorized with keyword “__restrict”
void prod (short *in_a, short * in_b, short *__restrict out, short len){
  int i;
  #pragma aligned(in_a,64)
  #pragma aligned(in_b,64)
  for (i = 0; i++; i < len){
  out[i] = in_a[i]*in_b[i];
  }
}