Unverified Commit cf754db9 authored by LudoBar's avatar LudoBar Committed by GitHub
Browse files

Fix the cuda compilation error on Windows (#1643)

parent d30e37d4
...@@ -47,7 +47,7 @@ __global__ void riroi_align_rotated_forward_cuda_kernel( ...@@ -47,7 +47,7 @@ __global__ void riroi_align_rotated_forward_cuda_kernel(
// find aligned index // find aligned index
scalar_t ind_float = theta * num_orientations / (2 * M_PI); scalar_t ind_float = theta * num_orientations / (2 * M_PI);
int ind = floor(ind_float); int ind = floorf(ind_float);
scalar_t l_var = ind_float - (scalar_t)ind; scalar_t l_var = ind_float - (scalar_t)ind;
scalar_t r_var = 1.0 - l_var; scalar_t r_var = 1.0 - l_var;
// correct start channel // correct start channel
...@@ -150,7 +150,7 @@ __global__ void riroi_align_rotated_backward_cuda_kernel( ...@@ -150,7 +150,7 @@ __global__ void riroi_align_rotated_backward_cuda_kernel(
// find aligned index // find aligned index
scalar_t ind_float = theta * num_orientations / (2 * M_PI); scalar_t ind_float = theta * num_orientations / (2 * M_PI);
int ind = floor(ind_float); int ind = floorf(ind_float);
scalar_t l_var = ind_float - (scalar_t)ind; scalar_t l_var = ind_float - (scalar_t)ind;
scalar_t r_var = 1.0 - l_var; scalar_t r_var = 1.0 - l_var;
// correct start channel // correct start channel
......
...@@ -23,20 +23,20 @@ __global__ void dynamic_voxelize_kernel( ...@@ -23,20 +23,20 @@ __global__ void dynamic_voxelize_kernel(
// To save some computation // To save some computation
auto points_offset = points + index * num_features; auto points_offset = points + index * num_features;
auto coors_offset = coors + index * NDim; auto coors_offset = coors + index * NDim;
int c_x = floor((points_offset[0] - coors_x_min) / voxel_x); int c_x = floorf((points_offset[0] - coors_x_min) / voxel_x);
if (c_x < 0 || c_x >= grid_x) { if (c_x < 0 || c_x >= grid_x) {
coors_offset[0] = -1; coors_offset[0] = -1;
continue; continue;
} }
int c_y = floor((points_offset[1] - coors_y_min) / voxel_y); int c_y = floorf((points_offset[1] - coors_y_min) / voxel_y);
if (c_y < 0 || c_y >= grid_y) { if (c_y < 0 || c_y >= grid_y) {
coors_offset[0] = -1; coors_offset[0] = -1;
coors_offset[1] = -1; coors_offset[1] = -1;
continue; continue;
} }
int c_z = floor((points_offset[2] - coors_z_min) / voxel_z); int c_z = floorf((points_offset[2] - coors_z_min) / voxel_z);
if (c_z < 0 || c_z >= grid_z) { if (c_z < 0 || c_z >= grid_z) {
coors_offset[0] = -1; coors_offset[0] = -1;
coors_offset[1] = -1; coors_offset[1] = -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment