From a9a1035e55643a59bda9979c002fa96a6b4a0b37 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 12 Jan 2019 13:45:59 +0100 Subject: [PATCH] Move IntSimdMatrixNative from IntSimdMatrix to unittest It is only used for the unit test. Signed-off-by: Stefan Weil --- src/arch/intsimdmatrix.cpp | 2 -- src/arch/intsimdmatrix.h | 1 - unittest/intsimdmatrix_test.cc | 4 +++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/arch/intsimdmatrix.cpp b/src/arch/intsimdmatrix.cpp index 509aec7a13..222ae78645 100644 --- a/src/arch/intsimdmatrix.cpp +++ b/src/arch/intsimdmatrix.cpp @@ -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. diff --git a/src/arch/intsimdmatrix.h b/src/arch/intsimdmatrix.h index 09ba4b050b..66034020ac 100644 --- a/src/arch/intsimdmatrix.h +++ b/src/arch/intsimdmatrix.h @@ -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. diff --git a/unittest/intsimdmatrix_test.cc b/unittest/intsimdmatrix_test.cc index a997d95929..70bc7eb657 100644 --- a/unittest/intsimdmatrix_test.cc +++ b/unittest/intsimdmatrix_test.cc @@ -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. @@ -64,7 +66,7 @@ class IntSimdMatrixTest : public ::testing::Test { GenericVector scales = RandomScales(num_out); std::vector base_result(num_out); std::vector dummy; - IntSimdMatrix::IntSimdMatrixNative.MatrixDotVector(w, dummy, scales, u.data(), base_result.data()); + IntSimdMatrixNative.MatrixDotVector(w, dummy, scales, u.data(), base_result.data()); std::vector test_result(num_out); std::vector shaped_wi; matrix.Init(w, shaped_wi);