Skip to content

Commit 7307e40

Browse files
committed
solve deformable_col2im: invalid argument by increasing channel
1 parent edb0393 commit 7307e40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mmdet/ops/dcn/src/deform_conv_cuda_kernel.cu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ using namespace at;
7373
i += blockDim.x * gridDim.x)
7474

7575
const int CUDA_NUM_THREADS = 1024;
76+
const int kMaxGridNum = 65535;
7677

7778
inline int GET_BLOCKS(const int N)
7879
{
79-
return (N + CUDA_NUM_THREADS - 1) / CUDA_NUM_THREADS;
80+
return std::min(kMaxGridNum, (N + CUDA_NUM_THREADS - 1) / CUDA_NUM_THREADS);
8081
}
8182

8283
template <typename scalar_t>

0 commit comments

Comments
 (0)