keep bitset naming consistent (#2004)

Signed-off-by: Xinyao Niu <morryniu123@gmail.com>
pull/2008/head^2
Morry Niu 2020-04-21 11:40:49 +10:00 committed by GitHub
parent 55cc6be6c9
commit 75ca0d96b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -45,7 +45,7 @@ __global__ void l2SelectMin1(Tensor<T, 2, true> productDistances,
// FIXME: if we have exact multiples, don't need this // FIXME: if we have exact multiples, don't need this
bool endRow = (blockIdx.x == gridDim.x - 1); bool endRow = (blockIdx.x == gridDim.x - 1);
bool bitsetIsEmpty = (bitset.getSize(0) == 0); bool bitsetEmpty = (bitset.getSize(0) == 0);
if (endRow) { if (endRow) {
if (productDistances.getSize(0) % kRowsPerBlock == 0) { if (productDistances.getSize(0) % kRowsPerBlock == 0) {
@ -57,7 +57,7 @@ __global__ void l2SelectMin1(Tensor<T, 2, true> productDistances,
for (int row = rowStart; row < productDistances.getSize(0); ++row) { for (int row = rowStart; row < productDistances.getSize(0); ++row) {
for (int col = threadIdx.x; col < productDistances.getSize(1); for (int col = threadIdx.x; col < productDistances.getSize(1);
col += blockDim.x) { col += blockDim.x) {
if (bitsetIsEmpty || (!(bitset[col >> 3] & (0x1 << (col & 0x7))))) { if (bitsetEmpty || (!(bitset[col >> 3] & (0x1 << (col & 0x7))))) {
distance[0] = Math<T>::add(centroidDistances[col], distance[0] = Math<T>::add(centroidDistances[col],
productDistances[row][col]); productDistances[row][col]);
} else { } else {
@ -149,11 +149,11 @@ __global__ void l2SelectMinK(Tensor<T, 2, true> productDistances,
int limit = utils::roundDown(productDistances.getSize(1), kWarpSize); int limit = utils::roundDown(productDistances.getSize(1), kWarpSize);
int i = threadIdx.x; int i = threadIdx.x;
bool bitsetIsEmpty = (bitset.getSize(0) == 0); bool bitsetEmpty = (bitset.getSize(0) == 0);
T v; T v;
for (; i < limit; i += blockDim.x) { for (; i < limit; i += blockDim.x) {
if (bitsetIsEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { if (bitsetEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) {
v = Math<T>::add(centroidDistances[i], v = Math<T>::add(centroidDistances[i],
productDistances[row][i]); productDistances[row][i]);
} else { } else {
@ -164,7 +164,7 @@ __global__ void l2SelectMinK(Tensor<T, 2, true> productDistances,
} }
if (i < productDistances.getSize(1)) { if (i < productDistances.getSize(1)) {
if (bitsetIsEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) { if (bitsetEmpty || (!(bitset[i >> 3] & (0x1 << (i & 0x7))))) {
v = Math<T>::add(centroidDistances[i], v = Math<T>::add(centroidDistances[i],
productDistances[row][i]); productDistances[row][i]);
} else { } else {

View File

@ -142,10 +142,10 @@ __global__ void blockSelect(Tensor<K, 2, true> in,
// Whole warps must participate in the selection // Whole warps must participate in the selection
int limit = utils::roundDown(in.getSize(1), kWarpSize); 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) { 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); heap.add(*inStart, (IndexType) i);
} else { } else {
heap.add(-1.0, (IndexType) i); heap.add(-1.0, (IndexType) i);
@ -156,7 +156,7 @@ __global__ void blockSelect(Tensor<K, 2, true> in,
// Handle last remainder fraction of a warp of elements // Handle last remainder fraction of a warp of elements
if (i < in.getSize(1)) { 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); heap.addThreadQ(*inStart, (IndexType) i);
} else { } else {
heap.addThreadQ(-1.0, (IndexType) i); heap.addThreadQ(-1.0, (IndexType) i);
@ -204,10 +204,10 @@ __global__ void blockSelectPair(Tensor<K, 2, true> inK,
// Whole warps must participate in the selection // Whole warps must participate in the selection
int limit = utils::roundDown(inK.getSize(1), kWarpSize); 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) { 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); heap.add(*inKStart, *inVStart);
} else { } else {
heap.add(-1.0, *inVStart); heap.add(-1.0, *inVStart);
@ -219,7 +219,7 @@ __global__ void blockSelectPair(Tensor<K, 2, true> inK,
// Handle last remainder fraction of a warp of elements // Handle last remainder fraction of a warp of elements
if (i < inK.getSize(1)) { 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); heap.addThreadQ(*inKStart, *inVStart);
} else { } else {
heap.addThreadQ(-1.0, *inVStart); heap.addThreadQ(-1.0, *inVStart);