From 75ca0d96b6196f45aea8101e1210e222147ab0ed Mon Sep 17 00:00:00 2001 From: Morry Niu Date: Tue, 21 Apr 2020 11:40:49 +1000 Subject: [PATCH] keep bitset naming consistent (#2004) Signed-off-by: Xinyao Niu --- core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu | 10 +++++----- .../thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu b/core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu index 367bf8465d..a46138c69f 100644 --- a/core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu +++ b/core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu @@ -45,7 +45,7 @@ __global__ void l2SelectMin1(Tensor productDistances, // FIXME: if we have exact multiples, don't need this bool endRow = (blockIdx.x == gridDim.x - 1); - bool bitsetIsEmpty = (bitset.getSize(0) == 0); + bool bitsetEmpty = (bitset.getSize(0) == 0); if (endRow) { if (productDistances.getSize(0) % kRowsPerBlock == 0) { @@ -57,7 +57,7 @@ __global__ void l2SelectMin1(Tensor productDistances, for (int row = rowStart; row < productDistances.getSize(0); ++row) { for (int col = threadIdx.x; col < productDistances.getSize(1); col += blockDim.x) { - if (bitsetIsEmpty || (!(bitset[col >> 3] & (0x1 << (col & 0x7))))) { + if (bitsetEmpty || (!(bitset[col >> 3] & (0x1 << (col & 0x7))))) { distance[0] = Math::add(centroidDistances[col], productDistances[row][col]); } else { @@ -149,11 +149,11 @@ __global__ void l2SelectMinK(Tensor productDistances, int limit = utils::roundDown(productDistances.getSize(1), kWarpSize); int i = threadIdx.x; - bool bitsetIsEmpty = (bitset.getSize(0) == 0); + bool bitsetEmpty = (bitset.getSize(0) == 0); T v; for (; i < limit; i += blockDim.x) { - if (bitsetIsEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { + if (bitsetEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { v = Math::add(centroidDistances[i], productDistances[row][i]); } else { @@ -164,7 +164,7 @@ __global__ void l2SelectMinK(Tensor productDistances, } if (i < productDistances.getSize(1)) { - if (bitsetIsEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { + if (bitsetEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { v = Math::add(centroidDistances[i], productDistances[row][i]); } else { diff --git a/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh b/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh index d8eb2075c1..37342de24b 100644 --- a/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh +++ b/core/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh @@ -142,10 +142,10 @@ __global__ void blockSelect(Tensor in, // Whole warps must participate in the selection int limit = utils::roundDown(in.getSize(1), kWarpSize); - bool bitsetIsEmpty = (bitset.getSize(0) == 0); + bool bitsetEmpty = (bitset.getSize(0) == 0); for (; i < limit; i += ThreadsPerBlock) { - if (bitsetIsEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { + if (bitsetEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { heap.add(*inStart, (IndexType) i); } else { heap.add(-1.0, (IndexType) i); @@ -156,7 +156,7 @@ __global__ void blockSelect(Tensor in, // Handle last remainder fraction of a warp of elements if (i < in.getSize(1)) { - if (bitsetIsEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { + if (bitsetEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { heap.addThreadQ(*inStart, (IndexType) i); } else { heap.addThreadQ(-1.0, (IndexType) i); @@ -204,10 +204,10 @@ __global__ void blockSelectPair(Tensor inK, // Whole warps must participate in the selection int limit = utils::roundDown(inK.getSize(1), kWarpSize); - bool bitsetIsEmpty = (bitset.getSize(0) == 0); + bool bitsetEmpty = (bitset.getSize(0) == 0); for (; i < limit; i += ThreadsPerBlock) { - if (bitsetIsEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { + if (bitsetEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { heap.add(*inKStart, *inVStart); } else { heap.add(-1.0, *inVStart); @@ -219,7 +219,7 @@ __global__ void blockSelectPair(Tensor inK, // Handle last remainder fraction of a warp of elements if (i < inK.getSize(1)) { - if (bitsetIsEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { + if (bitsetEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { heap.addThreadQ(*inKStart, *inVStart); } else { heap.addThreadQ(-1.0, *inVStart);