diff --git a/pytorch3d/csrc/ext.cpp b/pytorch3d/csrc/ext.cpp index 415d8770..7d31653a 100644 --- a/pytorch3d/csrc/ext.cpp +++ b/pytorch3d/csrc/ext.cpp @@ -105,15 +105,16 @@ PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { py::class_< pulsar::pytorch::Renderer, std::shared_ptr>(m, "PulsarRenderer") - .def(py::init< - const uint&, - const uint&, - const uint&, - const bool&, - const bool&, - const float&, - const uint&, - const uint&>()) + .def( + py::init< + const uint&, + const uint&, + const uint&, + const bool&, + const bool&, + const float&, + const uint&, + const uint&>()) .def( "__eq__", [](const pulsar::pytorch::Renderer& a, diff --git a/pytorch3d/csrc/point_mesh/point_mesh_cpu.cpp b/pytorch3d/csrc/point_mesh/point_mesh_cpu.cpp index e059409c..35c0b8ce 100644 --- a/pytorch3d/csrc/point_mesh/point_mesh_cpu.cpp +++ b/pytorch3d/csrc/point_mesh/point_mesh_cpu.cpp @@ -174,8 +174,8 @@ std::tuple HullHullDistanceForwardCpu( at::Tensor idxs = at::zeros({A_N,}, as_first_idx.options()); // clang-format on - auto as_a = as.accessor < float, H1 == 1 ? 2 : 3 > (); - auto bs_a = bs.accessor < float, H2 == 1 ? 2 : 3 > (); + auto as_a = as.accessor(); + auto bs_a = bs.accessor(); auto as_first_idx_a = as_first_idx.accessor(); auto bs_first_idx_a = bs_first_idx.accessor(); auto dists_a = dists.accessor(); @@ -230,10 +230,10 @@ std::tuple HullHullDistanceBackwardCpu( at::Tensor grad_as = at::zeros_like(as); at::Tensor grad_bs = at::zeros_like(bs); - auto as_a = as.accessor < float, H1 == 1 ? 2 : 3 > (); - auto bs_a = bs.accessor < float, H2 == 1 ? 2 : 3 > (); - auto grad_as_a = grad_as.accessor < float, H1 == 1 ? 2 : 3 > (); - auto grad_bs_a = grad_bs.accessor < float, H2 == 1 ? 2 : 3 > (); + auto as_a = as.accessor(); + auto bs_a = bs.accessor(); + auto grad_as_a = grad_as.accessor(); + auto grad_bs_a = grad_bs.accessor(); auto idx_bs_a = idx_bs.accessor(); auto grad_dists_a = grad_dists.accessor(); diff --git a/pytorch3d/csrc/pulsar/host/commands.h b/pytorch3d/csrc/pulsar/host/commands.h index a48eaaa9..4378303b 100644 --- a/pytorch3d/csrc/pulsar/host/commands.h +++ b/pytorch3d/csrc/pulsar/host/commands.h @@ -357,11 +357,11 @@ void MAX_WS( // // #define END_PARALLEL() \ - end_parallel :; \ + end_parallel:; \ } #define END_PARALLEL_NORET() } #define END_PARALLEL_2D() \ - end_parallel :; \ + end_parallel:; \ } \ } #define END_PARALLEL_2D_NORET() \ diff --git a/pytorch3d/csrc/pulsar/include/renderer.construct.device.h b/pytorch3d/csrc/pulsar/include/renderer.construct.device.h index 984f7710..bcfee6e9 100644 --- a/pytorch3d/csrc/pulsar/include/renderer.construct.device.h +++ b/pytorch3d/csrc/pulsar/include/renderer.construct.device.h @@ -52,7 +52,7 @@ HOST void construct( self->cam.film_width = width; self->cam.film_height = height; self->max_num_balls = max_num_balls; - MALLOC(self->result_d, float, width* height* n_channels); + MALLOC(self->result_d, float, width * height * n_channels); self->cam.orthogonal_projection = orthogonal_projection; self->cam.right_handed = right_handed_system; self->cam.background_normalization_depth = background_normalization_depth; @@ -93,7 +93,7 @@ HOST void construct( MALLOC(self->di_sorted_d, DrawInfo, max_num_balls); MALLOC(self->region_flags_d, char, max_num_balls); MALLOC(self->num_selected_d, size_t, 1); - MALLOC(self->forw_info_d, float, width* height * (3 + 2 * n_track)); + MALLOC(self->forw_info_d, float, width * height * (3 + 2 * n_track)); MALLOC(self->min_max_pixels_d, IntersectInfo, 1); MALLOC(self->grad_pos_d, float3, max_num_balls); MALLOC(self->grad_col_d, float, max_num_balls* n_channels); diff --git a/pytorch3d/csrc/pulsar/include/renderer.h b/pytorch3d/csrc/pulsar/include/renderer.h index d6755ee9..dac44cdc 100644 --- a/pytorch3d/csrc/pulsar/include/renderer.h +++ b/pytorch3d/csrc/pulsar/include/renderer.h @@ -255,7 +255,7 @@ GLOBAL void calc_signature( * for every iteration through the loading loop every thread could add a * 'hit' to the buffer. */ -#define RENDER_BUFFER_SIZE RENDER_BLOCK_SIZE* RENDER_BLOCK_SIZE * 2 +#define RENDER_BUFFER_SIZE RENDER_BLOCK_SIZE * RENDER_BLOCK_SIZE * 2 /** * The threshold after which the spheres that are in the render buffer * are rendered and the buffer is flushed. diff --git a/pytorch3d/csrc/utils/dispatch.cuh b/pytorch3d/csrc/utils/dispatch.cuh index 83f3d69f..144f38e3 100644 --- a/pytorch3d/csrc/utils/dispatch.cuh +++ b/pytorch3d/csrc/utils/dispatch.cuh @@ -99,8 +99,7 @@ namespace { // and increment it via template recursion until it is equal to the run-time // argument N. template < - template - class Kernel, + template class Kernel, typename T, int64_t minN, int64_t maxN, @@ -124,8 +123,7 @@ struct DispatchKernelHelper1D { // 1D dispatch: Specialization when curN == maxN // We need this base case to avoid infinite template recursion. template < - template - class Kernel, + template class Kernel, typename T, int64_t minN, int64_t maxN, @@ -145,8 +143,7 @@ struct DispatchKernelHelper1D { // the run-time values of N and M, at which point we dispatch to the run // method of the kernel. template < - template - class Kernel, + template class Kernel, typename T, int64_t minN, int64_t maxN, @@ -203,8 +200,7 @@ struct DispatchKernelHelper2D { // 2D dispatch, specialization for curN == maxN template < - template - class Kernel, + template class Kernel, typename T, int64_t minN, int64_t maxN, @@ -243,8 +239,7 @@ struct DispatchKernelHelper2D< // 2D dispatch, specialization for curM == maxM template < - template - class Kernel, + template class Kernel, typename T, int64_t minN, int64_t maxN, @@ -283,8 +278,7 @@ struct DispatchKernelHelper2D< // 2D dispatch, specialization for curN == maxN, curM == maxM template < - template - class Kernel, + template class Kernel, typename T, int64_t minN, int64_t maxN, @@ -313,8 +307,7 @@ struct DispatchKernelHelper2D< // This is the function we expect users to call to dispatch to 1D functions template < - template - class Kernel, + template class Kernel, typename T, int64_t minN, int64_t maxN, @@ -330,8 +323,7 @@ void DispatchKernel1D(const int64_t N, Args... args) { // This is the function we expect users to call to dispatch to 2D functions template < - template - class Kernel, + template class Kernel, typename T, int64_t minN, int64_t maxN,