Skip to content

Commit

Permalink
solve deformable_col2im: invalid argument by increasing channel
Browse files Browse the repository at this point in the history
  • Loading branch information
yhcao6 committed Apr 3, 2019
1 parent edb0393 commit 7307e40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mmdet/ops/dcn/src/deform_conv_cuda_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ using namespace at;
i += blockDim.x * gridDim.x)

const int CUDA_NUM_THREADS = 1024;
const int kMaxGridNum = 65535;

inline int GET_BLOCKS(const int N)
{
return (N + CUDA_NUM_THREADS - 1) / CUDA_NUM_THREADS;
return std::min(kMaxGridNum, (N + CUDA_NUM_THREADS - 1) / CUDA_NUM_THREADS);
}

template <typename scalar_t>
Expand Down

0 comments on commit 7307e40

Please sign in to comment.