Skip to content

Commit f21b91e

Browse files
committed
Fix SVS LVQ mode support detection.
1 parent b28888a commit f21b91e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/VecSim/algorithms/svs/svs_utils.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,15 @@ inline bool check_cpuid() {
147147
std::string((const char*)&ecx, 4);
148148
return (vendor_id == "GenuineIntel");
149149
}
150-
//clang-format on
150+
// clang-format on
151151

152152
inline bool isSVSLVQModeSupported(VecSimSvsQuantBits quant_bits) {
153+
return quant_bits == VecSimSvsQuant_NONE
153154
#if HAVE_SVS_LVQ
154-
// Check if the CPU supports SVS LVQ
155-
return check_cpuid();
155+
|| check_cpuid() // Check if the CPU supports SVS LVQ
156156
#endif
157-
return quant_bits == VecSimSvsQuant_NONE;
157+
;
158158
}
159-
160159
} // namespace svs_details
161160

162161
template <typename DataType, size_t QuantBits, size_t ResidualBits, class Enable = void>

src/VecSim/index_factories/svs_factory.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,4 @@ VecSimIndex *NewIndex(const VecSimParams *params, bool is_normalized) { return N
182182
size_t EstimateInitialSize(const SVSParams *params, bool is_normalized) { return -1; }
183183
size_t EstimateElementSize(const SVSParams *params) { return -1; }
184184
}; // namespace SVSFactory
185-
#endif // HAVE_SVS
185+
#endif // HAVE_SVS

tests/unit/test_svs.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2129,4 +2129,4 @@ TEST(SVSTest, svs_not_supported) {
21292129
ASSERT_EQ(size2, -1);
21302130
}
21312131

2132-
#endif
2132+
#endif

0 commit comments

Comments
 (0)