Commit 35a9fa40 authored by yan.yan's avatar yan.yan
Browse files

fix small bug for msvc

parent c0c9073d
...@@ -24,7 +24,7 @@ import re ...@@ -24,7 +24,7 @@ import re
NAME = 'spconv' NAME = 'spconv'
RELEASE_NAME = NAME RELEASE_NAME = NAME
deps = ["cumm"] deps = ["cumm"]
cuda_ver = os.environ.get("CUMM_CUDA_VERSON", "") cuda_ver = os.environ.get("CUMM_CUDA_VERSION", "")
if not cuda_ver: if not cuda_ver:
nvcc_version = subprocess.check_output(["nvcc", "--version" nvcc_version = subprocess.check_output(["nvcc", "--version"
]).decode("utf-8").strip() ]).decode("utf-8").strip()
......
...@@ -399,7 +399,6 @@ class Point2VoxelCPU(pccm.ParameterizedClass, pccm.pybind.PybindClassMixin): ...@@ -399,7 +399,6 @@ class Point2VoxelCPU(pccm.ParameterizedClass, pccm.pybind.PybindClassMixin):
auto N = points.dim(0); auto N = points.dim(0);
int c; int c;
TV_ASSERT_RT_ERR(num_features == voxels.dim(2), "your points num features doesn't equal to voxel."); TV_ASSERT_RT_ERR(num_features == voxels.dim(2), "your points num features doesn't equal to voxel.");
constexpr bool kUseMean = {pccm.boolean(mean)};
tv::dispatch<float, double>(points.dtype(), [&](auto I){{ tv::dispatch<float, double>(points.dtype(), [&](auto I){{
using T = decltype(I); using T = decltype(I);
auto points_rw = points.tview<T, 2>(); auto points_rw = points.tview<T, 2>();
...@@ -443,7 +442,7 @@ class Point2VoxelCPU(pccm.ParameterizedClass, pccm.pybind.PybindClassMixin): ...@@ -443,7 +442,7 @@ class Point2VoxelCPU(pccm.ParameterizedClass, pccm.pybind.PybindClassMixin):
voxels_rw(voxelidx, num, k) = points_rw(i, k); voxels_rw(voxelidx, num, k) = points_rw(i, k);
}} }}
num_points_per_voxel_rw(voxelidx) += 1; num_points_per_voxel_rw(voxelidx) += 1;
if TV_IF_CONSTEXPR (kUseMean){{ if TV_IF_CONSTEXPR ({pccm.boolean(mean)}){{
for (int k = 0; k < num_features; ++k) {{ for (int k = 0; k < num_features; ++k) {{
means_rw(voxelidx, k) += means_rw(voxelidx, k) +=
(points_rw(i, k) - means_rw(voxelidx, k)) / {self.dtype}(num + 1); (points_rw(i, k) - means_rw(voxelidx, k)) / {self.dtype}(num + 1);
...@@ -453,7 +452,7 @@ class Point2VoxelCPU(pccm.ParameterizedClass, pccm.pybind.PybindClassMixin): ...@@ -453,7 +452,7 @@ class Point2VoxelCPU(pccm.ParameterizedClass, pccm.pybind.PybindClassMixin):
}} }}
for (int i = 0; i < voxel_num; ++i) {{ for (int i = 0; i < voxel_num; ++i) {{
coor_to_voxelidx_rw({codeops.unpack("coors_rw", range(self.ndim), left="(i, ", right=")")}) = -1; coor_to_voxelidx_rw({codeops.unpack("coors_rw", range(self.ndim), left="(i, ", right=")")}) = -1;
if TV_IF_CONSTEXPR (kUseMean){{ if TV_IF_CONSTEXPR ({pccm.boolean(mean)}){{
num = num_points_per_voxel_rw(i); num = num_points_per_voxel_rw(i);
for (int j = num; j < max_num_points_per_voxel; ++j) {{ for (int j = num; j < max_num_points_per_voxel; ++j) {{
for (int k = 0; k < num_features; ++k) {{ for (int k = 0; k < num_features; ++k) {{
......
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