diff --git a/unittest/benchmark/benchmark_base.h b/unittest/benchmark/benchmark_base.h index 6b4e9d3be..c76d19127 100644 --- a/unittest/benchmark/benchmark_base.h +++ b/unittest/benchmark/benchmark_base.h @@ -24,6 +24,7 @@ class Benchmark_base { public: inline void normalize(float* arr, int32_t nq, int32_t dim) { +#pragma omp parallel for for (int32_t i = 0; i < nq; i++) { double vecLen = 0.0, inv_vecLen = 0.0; for (int32_t j = 0; j < dim; j++) { diff --git a/unittest/benchmark/hdf5/benchmark_knowhere_float_range.cpp b/unittest/benchmark/hdf5/benchmark_knowhere_float_range.cpp index b0b78fa31..9bf5d08d4 100644 --- a/unittest/benchmark/hdf5/benchmark_knowhere_float_range.cpp +++ b/unittest/benchmark/hdf5/benchmark_knowhere_float_range.cpp @@ -117,8 +117,13 @@ class Benchmark_knowhere_float_range : public Benchmark_knowhere, public ::testi assert(metric_str_ == METRIC_IP_STR || metric_str_ == METRIC_L2_STR); metric_type_ = (metric_str_ == METRIC_IP_STR) ? knowhere::metric::IP : knowhere::metric::L2; knowhere::SetMetaMetricType(cfg_, metric_type_); - knowhere::SetMetaRadiusLowBound(cfg_, 0.0f); - knowhere::SetMetaRadiusHighBound(cfg_, *gt_radius_); + if (metric_type_ == knowhere::metric::IP) { + knowhere::SetMetaRadiusLowBound(cfg_, *gt_radius_); + knowhere::SetMetaRadiusHighBound(cfg_, 1.01f); + } else { + knowhere::SetMetaRadiusLowBound(cfg_, 0.0f); + knowhere::SetMetaRadiusHighBound(cfg_, *gt_radius_); + } knowhere::KnowhereConfig::SetSimdType(knowhere::KnowhereConfig::SimdType::AVX2); printf("faiss::distance_compute_blas_threshold: %ld\n", knowhere::KnowhereConfig::GetBlasThreshold()); }