Skip to content

Commit

Permalink
Fixed GET_BLOCKS int/int64_t types issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 committed Sep 2, 2021
1 parent 20fb5ac commit 3498de6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,9 @@ inline unsigned int GET_THREADS() {
return 512;
}

inline unsigned int GET_BLOCKS(
const unsigned int THREADS,
const unsigned int64_t N) {
unsigned int kMaxGridNum =
at::cuda::getCurrentDeviceProperties()->maxGridSize[0];
return std::min(kMaxGridNum, (N + THREADS - 1) / THREADS);
inline unsigned int GET_BLOCKS(const unsigned int THREADS, const int64_t N) {
int64_t kMaxGridNum = at::cuda::getCurrentDeviceProperties()->maxGridSize[0];
return (unsigned int)std::min(kMaxGridNum, (N + THREADS - 1) / THREADS);
}

template <typename scalar_t, typename index_t>
Expand Down

0 comments on commit 3498de6

Please sign in to comment.