mirror of
https://github.com/facebookresearch/faiss.git
synced 2026-10-12 02:13:36 +00:00
Fix CQS signal readability-braces-around-statements in fbcode/faiss/benchs (#4449)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4449 Reviewed By: dtolnay Differential Revision: D78795472 fbshipit-source-id: 227e3beb472f06f5c2897f7f4a7b6713ab06a4cb
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1ff5912ca0
commit
9595cbb1ca
@@ -52,8 +52,9 @@ static void bench(benchmark::State& state) {
|
||||
|
||||
size_t ndiff = 0;
|
||||
for (size_t i = 0; i < codes.size(); i++) {
|
||||
if (codes[i] != codes2[i])
|
||||
if (codes[i] != codes2[i]) {
|
||||
ndiff++;
|
||||
}
|
||||
}
|
||||
|
||||
state.counters["ndiff_for_idempotence"] = ndiff;
|
||||
|
||||
@@ -295,8 +295,9 @@ static void verifyIndex2LevelDecoder(
|
||||
1,
|
||||
encodedData.data() + pointIdx * codeSize,
|
||||
tempFaiss.data());
|
||||
for (uint64_t j = 0; j < d; j++)
|
||||
for (uint64_t j = 0; j < d; j++) {
|
||||
outputFaiss[i * d + j] += weight * tempFaiss[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
const double timeFaiss = swFaiss.elapsed();
|
||||
|
||||
@@ -38,8 +38,9 @@ struct HammingComputerM8 {
|
||||
int hamming(const uint8_t* b8) const {
|
||||
const uint64_t* b = (uint64_t*)b8;
|
||||
int accu = 0;
|
||||
for (int i = 0; i < n; i++)
|
||||
for (int i = 0; i < n; i++) {
|
||||
accu += popcount64(a[i] ^ b[i]);
|
||||
}
|
||||
return accu;
|
||||
}
|
||||
|
||||
@@ -67,8 +68,9 @@ struct HammingComputerM4 {
|
||||
int hamming(const uint8_t* b8) const {
|
||||
const uint32_t* b = (uint32_t*)b8;
|
||||
int accu = 0;
|
||||
for (int i = 0; i < n; i++)
|
||||
for (int i = 0; i < n; i++) {
|
||||
accu += popcount64(a[i] ^ b[i]);
|
||||
}
|
||||
return accu;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user