Skip to content

Commit

Permalink
https://github.com/torch/cunn/issues/492
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoto7250 committed Feb 22, 2023
1 parent bfb9891 commit 1e4d0e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/THCUNN/LookupTable.cu
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "THCHalf.h"
#include "THCHalfAutoNumerics.cuh"
#include "THCTensorSort.cuh"
#define FULL_MASK 0xffffffff

const int WARP_SIZE = 32;

Expand All @@ -29,7 +30,7 @@ __device__ __forceinline__ bool warpHasCollision(int val)
#pragma unroll
for (int i = 1; i <= 16; i++)
{
dup |= (__shfl(val, (laneId + i) % 32) == val);
dup |= (__shfl_sync(FULL_MASK, val, (laneId + i) % 32) == val);
}

#else
Expand All @@ -46,7 +47,7 @@ __device__ __forceinline__ bool warpHasCollision(int val)

#endif

return __any(dup) != 0;
return __any_sync(FULL_MASK, dup) != 0;
}

template <typename Dtype>
Expand Down

0 comments on commit 1e4d0e5

Please sign in to comment.