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 30a2324
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ inline unsigned int GET_THREADS() {

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

template <typename scalar_t, typename index_t>
Expand Down

0 comments on commit 30a2324

Please sign in to comment.