File tree 5 files changed +6
-6
lines changed
5 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ namespace tesseract {
28
28
// Factory makes and returns an IntSimdMatrix (sub)class of the best
29
29
// available type for the current architecture.
30
30
/* static */
31
- IntSimdMatrix* IntSimdMatrix::GetFastestMultiplier () {
32
- IntSimdMatrix* multiplier;
31
+ const IntSimdMatrix* IntSimdMatrix::GetFastestMultiplier () {
32
+ const IntSimdMatrix* multiplier;
33
33
if (SIMDDetect::IsAVX2Available ()) {
34
34
multiplier = new IntSimdMatrixAVX2 ();
35
35
} else if (SIMDDetect::IsSSEAvailable ()) {
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class IntSimdMatrix {
71
71
72
72
// Factory makes and returns an IntSimdMatrix (sub)class of the best
73
73
// available type for the current architecture.
74
- static IntSimdMatrix* GetFastestMultiplier ();
74
+ static const IntSimdMatrix* GetFastestMultiplier ();
75
75
76
76
// Computes a reshaped copy of the weight matrix w. If there are no
77
77
// partial_funcs_, it does nothing.
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const float kMinProb = exp(kMinCertainty);
34
34
// Holds the optimal integer multiplier for this machine.
35
35
// This is a leaked, lazily initialized singleton, and is used for computing
36
36
// padding to apply to i_ for SIMD use.
37
- IntSimdMatrix* NetworkIO::multiplier_ = nullptr ;
37
+ const IntSimdMatrix* NetworkIO::multiplier_ = nullptr ;
38
38
39
39
// Resizes to a specific size as a 2-d temp buffer. No batches, no y-dim.
40
40
void NetworkIO::Resize2d (bool int_mode, int width, int num_features) {
Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ class NetworkIO {
341
341
// Holds the optimal integer multiplier for this machine.
342
342
// This is a leaked, lazily initialized singleton, and is used for computing
343
343
// padding to apply to i_ for SIMD use.
344
- static IntSimdMatrix* multiplier_;
344
+ static const IntSimdMatrix* multiplier_;
345
345
};
346
346
347
347
} // namespace tesseract.
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ class WeightMatrix {
179
179
// The weights matrix reorganized in whatever way suits this instance.
180
180
std::vector<int8_t > shaped_w_;
181
181
// Holds the optimal integer multiplier for this machine.
182
- std::unique_ptr<IntSimdMatrix> multiplier_;
182
+ std::unique_ptr<const IntSimdMatrix> multiplier_;
183
183
};
184
184
185
185
} // namespace tesseract.
You can’t perform that action at this time.
0 commit comments