Skip to content

Commit

Permalink
Make ceil_div __host__ __device__ (#2217)
Browse files Browse the repository at this point in the history
Fixes #2214 (comment)

I don't know why the building is not working with `--expt-relaxed-constexpr` flag set, but it is generally a good idea to declare this as `__host__ __device__`
  • Loading branch information
zasdfgbnm committed May 14, 2020
1 parent cc4c2af commit a6073f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchvision/csrc/cuda/cuda_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
i += (blockDim.x * gridDim.x))

template <typename integer>
constexpr inline integer ceil_div(integer n, integer m) {
constexpr __host__ __device__ inline integer ceil_div(integer n, integer m) {
return (n + m - 1) / m;
}

0 comments on commit a6073f0

Please sign in to comment.