tesseract  4.00.00dev
/home/stefan/src/github/tesseract-ocr/tesseract/dotproduct-main.cpp
Go to the documentation of this file.
1 #include <stdio.h>
2 
3 const int max = 65536;
4 
5 double u[max];
6 double v[max];
7 
8 double DotProductAVX(const double* u, const double* v, int n);
9 double DotProductSIMD(const double* u, const double* v, int n);
10 double DotProduct(const double* u, const double* v, int n);
11 
12 int main() {
13 #if 0
14  // 5.6
15  printf("DotProduct\n");
16  for (unsigned i = 0; i < 1000000; i++)
17  DotProduct(u, v, max);
18 #elif 0
19  // 5.6
20  printf("DotProductSIMD\n");
21  for (unsigned i = 0; i < 1000000; i++)
22  DotProductSIMD(u, v, max);
23 #else
24  // 1.5
25  printf("DotProductAVX\n");
26  for (unsigned i = 0; i < 1000000; i++)
27  DotProductAVX(u, v, max);
28 #endif
29  return 0;
30 }
double u[max]
int main()
double DotProduct(const double *u, const double *v, int n)
const int max
double DotProductSIMD(const double *u, const double *v, int n)
double DotProductAVX(const double *u, const double *v, int n)
double v[max]