Skip to content

Commit

Permalink
Remove test code for fast float dotproduct
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 3eae6d7 commit 9a8a4dc
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions src/arch/intsimdmatrixavx2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,6 @@
# if defined(__i686__) || defined(__x86_64__)
# error Implementation only for AVX2 capable architectures
# endif
#elif defined(FAST_FLOAT)
namespace tesseract {

static void matrixDotVector(int dim1, int dim2, const int8_t *wi, const float *scales,
const int8_t *u, float *v) {
const int num_out = dim1;
const int num_in = dim2 - 1;
for (int i = 0; i < num_out; ++i) {
for (int j = 0; j < num_in; ++j) {
}
}
}

#if 0
void IntSimdMatrix::MatrixDotVector(const GENERIC_2D_ARRAY<int8_t> &w,
const std::vector<TFloat> &scales, const int8_t *u, TFloat *v) {
int num_out = w.dim1();
int num_in = w.dim2() - 1;
// Base implementation.
for (int i = 0; i < num_out; ++i) {
const int8_t *wi = w[i];
int total = 0;
for (int j = 0; j < num_in; ++j) {
total += wi[j] * u[j];
}
// Add in the bias and correct for integer values.
v[i] = (total + wi[num_in] * INT8_MAX) * scales[i];
}
}
#endif

static const IntSimdMatrix simdMatrix = {
// Function.
matrixDotVector,
// Number of 32 bit outputs held in each register.
1,
// Maximum number of registers that we will use to hold outputs.
1,
// Number of 8 bit inputs in the inputs register.
1,
// Number of inputs in each weight group.
1
};

const IntSimdMatrix *IntSimdMatrix::intSimdMatrixAVX2 = &simdMatrix;
}
#else
# include <immintrin.h>
# include <algorithm>
Expand Down

0 comments on commit 9a8a4dc

Please sign in to comment.