Skip to content

Commit

Permalink
Patch LookupTable
Browse files Browse the repository at this point in the history
See torch/issues/492 for reference
  • Loading branch information
ashwin2802 committed Mar 6, 2021
1 parent 1ae6aa0 commit 4ea8700
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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
3 changes: 2 additions & 1 deletion rocks/cunn-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package = "cunn"
version = "scm-1"

source = {
url = "git://github.com/torch/cunn.git",
url = "git://github.com/ashwin2802/cunn.git",
branch = "cuda11"
}

description = {
Expand Down

0 comments on commit 4ea8700

Please sign in to comment.