Skip to content

Commit

Permalink
Fix DotProductNative for TFloat
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jul 13, 2021
1 parent a09531a commit 1a59b6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/arch/dotproduct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ namespace tesseract {

// Computes and returns the dot product of the two n-vectors u and v.
TFloat DotProductNative(const TFloat *u, const TFloat *v, int n) {
double total = 0.0;
for (int k = 0; k < n; ++k) {
TFloat total = 0;
#pragma omp simdi reduction(+:total)
for (int k = 0; k < n; k++) {
total += u[k] * v[k];
}
return total;
Expand Down

0 comments on commit 1a59b6f

Please sign in to comment.