Skip to content

Commit

Permalink
[fix] vren build error on windows cause long
Browse files Browse the repository at this point in the history
  • Loading branch information
zjjMaiMai committed Jul 24, 2022
1 parent bede6be commit 2d20cc4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions models/csrc/intersection.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ __global__ void ray_aabb_intersect_kernel(
const int max_hits,
int* hit_cnt,
torch::PackedTensorAccessor32<float, 3, torch::RestrictPtrTraits> hits_t,
torch::PackedTensorAccessor64<long, 2, torch::RestrictPtrTraits> hits_voxel_idx
torch::PackedTensorAccessor64<int64_t, 2, torch::RestrictPtrTraits> hits_voxel_idx
){
const int r = blockIdx.x * blockDim.x + threadIdx.x;
const int v = blockIdx.y * blockDim.y + threadIdx.y;
Expand Down Expand Up @@ -87,7 +87,7 @@ std::vector<torch::Tensor> ray_aabb_intersect_cu(
max_hits,
hit_cnt.data_ptr<int>(),
hits_t.packed_accessor32<float, 3, torch::RestrictPtrTraits>(),
hits_voxel_idx.packed_accessor64<long, 2, torch::RestrictPtrTraits>()
hits_voxel_idx.packed_accessor64<int64_t, 2, torch::RestrictPtrTraits>()
);
}));

Expand Down Expand Up @@ -129,7 +129,7 @@ __global__ void ray_sphere_intersect_kernel(
const int max_hits,
int* hit_cnt,
torch::PackedTensorAccessor32<float, 3, torch::RestrictPtrTraits> hits_t,
torch::PackedTensorAccessor64<long, 2, torch::RestrictPtrTraits> hits_sphere_idx
torch::PackedTensorAccessor64<int64_t, 2, torch::RestrictPtrTraits> hits_sphere_idx
){
const int r = blockIdx.x * blockDim.x + threadIdx.x;
const int s = blockIdx.y * blockDim.y + threadIdx.y;
Expand Down Expand Up @@ -184,7 +184,7 @@ std::vector<torch::Tensor> ray_sphere_intersect_cu(
max_hits,
hit_cnt.data_ptr<int>(),
hits_t.packed_accessor32<float, 3, torch::RestrictPtrTraits>(),
hits_sphere_idx.packed_accessor64<long, 2, torch::RestrictPtrTraits>()
hits_sphere_idx.packed_accessor64<int64_t, 2, torch::RestrictPtrTraits>()
);
}));

Expand Down
4 changes: 2 additions & 2 deletions models/csrc/raymarching.cu
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ __global__ void raymarching_test_kernel(
const torch::PackedTensorAccessor32<float, 2, torch::RestrictPtrTraits> rays_o,
const torch::PackedTensorAccessor32<float, 2, torch::RestrictPtrTraits> rays_d,
torch::PackedTensorAccessor32<float, 2, torch::RestrictPtrTraits> hits_t,
const torch::PackedTensorAccessor64<long, 1, torch::RestrictPtrTraits> alive_indices,
const torch::PackedTensorAccessor64<int64_t, 1, torch::RestrictPtrTraits> alive_indices,
const uint8_t* __restrict__ density_bitfield,
const int cascades,
const int grid_size,
Expand Down Expand Up @@ -434,7 +434,7 @@ std::vector<torch::Tensor> raymarching_test_cu(
rays_o.packed_accessor32<float, 2, torch::RestrictPtrTraits>(),
rays_d.packed_accessor32<float, 2, torch::RestrictPtrTraits>(),
hits_t.packed_accessor32<float, 2, torch::RestrictPtrTraits>(),
alive_indices.packed_accessor64<long, 1, torch::RestrictPtrTraits>(),
alive_indices.packed_accessor64<int64_t, 1, torch::RestrictPtrTraits>(),
density_bitfield.data_ptr<uint8_t>(),
cascades,
grid_size,
Expand Down
4 changes: 2 additions & 2 deletions models/csrc/volumerendering.cu
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ __global__ void composite_test_fw_kernel(
const torch::PackedTensorAccessor<scalar_t, 2, torch::RestrictPtrTraits, size_t> deltas,
const torch::PackedTensorAccessor<scalar_t, 2, torch::RestrictPtrTraits, size_t> ts,
const torch::PackedTensorAccessor<scalar_t, 2, torch::RestrictPtrTraits, size_t> hits_t,
torch::PackedTensorAccessor64<long, 1, torch::RestrictPtrTraits> alive_indices,
torch::PackedTensorAccessor64<int64_t, 1, torch::RestrictPtrTraits> alive_indices,
const scalar_t T_threshold,
const torch::PackedTensorAccessor32<int, 1, torch::RestrictPtrTraits> N_eff_samples,
torch::PackedTensorAccessor<scalar_t, 1, torch::RestrictPtrTraits, size_t> opacity,
Expand Down Expand Up @@ -258,7 +258,7 @@ void composite_test_fw_cu(
deltas.packed_accessor<scalar_t, 2, torch::RestrictPtrTraits, size_t>(),
ts.packed_accessor<scalar_t, 2, torch::RestrictPtrTraits, size_t>(),
hits_t.packed_accessor<scalar_t, 2, torch::RestrictPtrTraits, size_t>(),
alive_indices.packed_accessor64<long, 1, torch::RestrictPtrTraits>(),
alive_indices.packed_accessor64<int64_t, 1, torch::RestrictPtrTraits>(),
T_threshold,
N_eff_samples.packed_accessor32<int, 1, torch::RestrictPtrTraits>(),
opacity.packed_accessor<scalar_t, 1, torch::RestrictPtrTraits, size_t>(),
Expand Down

0 comments on commit 2d20cc4

Please sign in to comment.