未验证 提交 8c79ba16 编写于 作者: X XuanYang-cn 提交者: GitHub

fix pq distances cal bug (#3876)

Signed-off-by: Nyangxuan <xuan.yang@zilliz.com>
Co-authored-by: Nyangxuan <xuan.yang@zilliz.com>
上级 2eec5607
......@@ -51,12 +51,6 @@ pqCodeDistances(Tensor<float, 2, true> queries,
auto code = threadIdx.x;
auto subQuantizer = blockIdx.y;
// Each thread will load the pq centroid data for the code that it
// is processing
#pragma unroll
for (int i = 0; i < DimsPerSubQuantizer; ++i) {
subQuantizerData[i] = pqCentroids[subQuantizer][i][code].ldg();
}
// Where we store our query vector
float* smemQuery = smem;
......@@ -152,6 +146,14 @@ pqCodeDistances(Tensor<float, 2, true> queries,
}
}
} else {
// Each thread will load the pq centroid data for the code that it
// is processing
#pragma unroll
for (int i = 0; i < DimsPerSubQuantizer; ++i) {
subQuantizerData[i] = pqCentroids[subQuantizer][i][code].ldg();
}
// These are the processing threads
float dist = 0.0f;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册