mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
Add const attributes to IntSimMatrix multiplier
IntSimMatrix no longer contains variable members. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
7c70147701
commit
e237a38405
@ -28,8 +28,8 @@ namespace tesseract {
|
||||
// Factory makes and returns an IntSimdMatrix (sub)class of the best
|
||||
// available type for the current architecture.
|
||||
/* static */
|
||||
IntSimdMatrix* IntSimdMatrix::GetFastestMultiplier() {
|
||||
IntSimdMatrix* multiplier;
|
||||
const IntSimdMatrix* IntSimdMatrix::GetFastestMultiplier() {
|
||||
const IntSimdMatrix* multiplier;
|
||||
if (SIMDDetect::IsAVX2Available()) {
|
||||
multiplier = new IntSimdMatrixAVX2();
|
||||
} else if (SIMDDetect::IsSSEAvailable()) {
|
||||
|
@ -71,7 +71,7 @@ class IntSimdMatrix {
|
||||
|
||||
// Factory makes and returns an IntSimdMatrix (sub)class of the best
|
||||
// available type for the current architecture.
|
||||
static IntSimdMatrix* GetFastestMultiplier();
|
||||
static const IntSimdMatrix* GetFastestMultiplier();
|
||||
|
||||
// Computes a reshaped copy of the weight matrix w. If there are no
|
||||
// partial_funcs_, it does nothing.
|
||||
|
@ -34,7 +34,7 @@ const float kMinProb = exp(kMinCertainty);
|
||||
// Holds the optimal integer multiplier for this machine.
|
||||
// This is a leaked, lazily initialized singleton, and is used for computing
|
||||
// padding to apply to i_ for SIMD use.
|
||||
IntSimdMatrix* NetworkIO::multiplier_ = nullptr;
|
||||
const IntSimdMatrix* NetworkIO::multiplier_ = nullptr;
|
||||
|
||||
// Resizes to a specific size as a 2-d temp buffer. No batches, no y-dim.
|
||||
void NetworkIO::Resize2d(bool int_mode, int width, int num_features) {
|
||||
|
@ -341,7 +341,7 @@ class NetworkIO {
|
||||
// Holds the optimal integer multiplier for this machine.
|
||||
// This is a leaked, lazily initialized singleton, and is used for computing
|
||||
// padding to apply to i_ for SIMD use.
|
||||
static IntSimdMatrix* multiplier_;
|
||||
static const IntSimdMatrix* multiplier_;
|
||||
};
|
||||
|
||||
} // namespace tesseract.
|
||||
|
@ -179,7 +179,7 @@ class WeightMatrix {
|
||||
// The weights matrix reorganized in whatever way suits this instance.
|
||||
std::vector<int8_t> shaped_w_;
|
||||
// Holds the optimal integer multiplier for this machine.
|
||||
std::unique_ptr<IntSimdMatrix> multiplier_;
|
||||
std::unique_ptr<const IntSimdMatrix> multiplier_;
|
||||
};
|
||||
|
||||
} // namespace tesseract.
|
||||
|
Loading…
Reference in New Issue
Block a user