Skip to content

Commit a9a1035

Browse files
committed
Move IntSimdMatrixNative from IntSimdMatrix to unittest
It is only used for the unit test. Signed-off-by: Stefan Weil <[email protected]>
1 parent d36231e commit a9a1035

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/arch/intsimdmatrix.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
namespace tesseract {
2525

2626
const IntSimdMatrix* IntSimdMatrix::intSimdMatrix = nullptr;
27-
const IntSimdMatrix IntSimdMatrix::IntSimdMatrixNative =
28-
IntSimdMatrix(1, 1, 1, 1, 1, {});
2927

3028
// Computes a reshaped copy of the weight matrix w. If there are no
3129
// partial_funcs_, it does nothing.

src/arch/intsimdmatrix.h

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ class IntSimdMatrix {
114114
static const IntSimdMatrix* intSimdMatrix;
115115
static const IntSimdMatrix IntSimdMatrixAVX2;
116116
static const IntSimdMatrix IntSimdMatrixSSE;
117-
static const IntSimdMatrix IntSimdMatrixNative;
118117

119118
protected:
120119
// Rounds the input up to a multiple of the given factor.

unittest/intsimdmatrix_test.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
namespace tesseract {
2626
namespace {
2727

28+
static const IntSimdMatrix IntSimdMatrixNative = IntSimdMatrix(1, 1, 1, 1, 1, {});
29+
2830
class IntSimdMatrixTest : public ::testing::Test {
2931
protected:
3032
// Makes a random weights matrix of the given size.
@@ -64,7 +66,7 @@ class IntSimdMatrixTest : public ::testing::Test {
6466
GenericVector<double> scales = RandomScales(num_out);
6567
std::vector<double> base_result(num_out);
6668
std::vector<int8_t> dummy;
67-
IntSimdMatrix::IntSimdMatrixNative.MatrixDotVector(w, dummy, scales, u.data(), base_result.data());
69+
IntSimdMatrixNative.MatrixDotVector(w, dummy, scales, u.data(), base_result.data());
6870
std::vector<double> test_result(num_out);
6971
std::vector<int8_t> shaped_wi;
7072
matrix.Init(w, shaped_wi);

0 commit comments

Comments
 (0)