Skip to content

Commit

Permalink
Move IntSimdMatrixNative from IntSimdMatrix to unittest
Browse files Browse the repository at this point in the history
It is only used for the unit test.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jan 14, 2019
1 parent d36231e commit a9a1035
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/arch/intsimdmatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
namespace tesseract {

const IntSimdMatrix* IntSimdMatrix::intSimdMatrix = nullptr;
const IntSimdMatrix IntSimdMatrix::IntSimdMatrixNative =
IntSimdMatrix(1, 1, 1, 1, 1, {});

// Computes a reshaped copy of the weight matrix w. If there are no
// partial_funcs_, it does nothing.
Expand Down
1 change: 0 additions & 1 deletion src/arch/intsimdmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class IntSimdMatrix {
static const IntSimdMatrix* intSimdMatrix;
static const IntSimdMatrix IntSimdMatrixAVX2;
static const IntSimdMatrix IntSimdMatrixSSE;
static const IntSimdMatrix IntSimdMatrixNative;

protected:
// Rounds the input up to a multiple of the given factor.
Expand Down
4 changes: 3 additions & 1 deletion unittest/intsimdmatrix_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
namespace tesseract {
namespace {

static const IntSimdMatrix IntSimdMatrixNative = IntSimdMatrix(1, 1, 1, 1, 1, {});

class IntSimdMatrixTest : public ::testing::Test {
protected:
// Makes a random weights matrix of the given size.
Expand Down Expand Up @@ -64,7 +66,7 @@ class IntSimdMatrixTest : public ::testing::Test {
GenericVector<double> scales = RandomScales(num_out);
std::vector<double> base_result(num_out);
std::vector<int8_t> dummy;
IntSimdMatrix::IntSimdMatrixNative.MatrixDotVector(w, dummy, scales, u.data(), base_result.data());
IntSimdMatrixNative.MatrixDotVector(w, dummy, scales, u.data(), base_result.data());
std::vector<double> test_result(num_out);
std::vector<int8_t> shaped_wi;
matrix.Init(w, shaped_wi);
Expand Down

0 comments on commit a9a1035

Please sign in to comment.