未验证 提交 75ca0d96 编写于 作者: M Morry Niu 提交者: GitHub

keep bitset naming consistent (#2004)

Signed-off-by: NXinyao Niu <morryniu123@gmail.com>
上级 55cc6be6
......@@ -45,7 +45,7 @@ __global__ void l2SelectMin1(Tensor<T, 2, true> 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<T, 2, true> 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<T>::add(centroidDistances[col],
productDistances[row][col]);
} else {
......@@ -149,11 +149,11 @@ __global__ void l2SelectMinK(Tensor<T, 2, true> 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<T>::add(centroidDistances[i],
productDistances[row][i]);
} else {
......@@ -164,7 +164,7 @@ __global__ void l2SelectMinK(Tensor<T, 2, true> productDistances,
}
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],
productDistances[row][i]);
} else {
......
......@@ -142,10 +142,10 @@ __global__ void blockSelect(Tensor<K, 2, true> 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<K, 2, true> 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<K, 2, true> 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<K, 2, true> 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册