mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-21 06:40:35 +08:00
clang-format | Format fbsource with clang-format 21.
Reviewed By: ChristianK275 Differential Revision: D85317706 fbshipit-source-id: b399c5c4b75252999442b7d7d2778e7a241b0025
This commit is contained in:
committed by
meta-codesync[bot]
parent
fc6a6b8951
commit
45df20e9e2
@@ -105,7 +105,8 @@ PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
|
|||||||
py::class_<
|
py::class_<
|
||||||
pulsar::pytorch::Renderer,
|
pulsar::pytorch::Renderer,
|
||||||
std::shared_ptr<pulsar::pytorch::Renderer>>(m, "PulsarRenderer")
|
std::shared_ptr<pulsar::pytorch::Renderer>>(m, "PulsarRenderer")
|
||||||
.def(py::init<
|
.def(
|
||||||
|
py::init<
|
||||||
const uint&,
|
const uint&,
|
||||||
const uint&,
|
const uint&,
|
||||||
const uint&,
|
const uint&,
|
||||||
|
|||||||
@@ -174,8 +174,8 @@ std::tuple<at::Tensor, at::Tensor> HullHullDistanceForwardCpu(
|
|||||||
at::Tensor idxs = at::zeros({A_N,}, as_first_idx.options());
|
at::Tensor idxs = at::zeros({A_N,}, as_first_idx.options());
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
auto as_a = as.accessor < float, H1 == 1 ? 2 : 3 > ();
|
auto as_a = as.accessor<float, H1 == 1 ? 2 : 3>();
|
||||||
auto bs_a = bs.accessor < float, H2 == 1 ? 2 : 3 > ();
|
auto bs_a = bs.accessor<float, H2 == 1 ? 2 : 3>();
|
||||||
auto as_first_idx_a = as_first_idx.accessor<int64_t, 1>();
|
auto as_first_idx_a = as_first_idx.accessor<int64_t, 1>();
|
||||||
auto bs_first_idx_a = bs_first_idx.accessor<int64_t, 1>();
|
auto bs_first_idx_a = bs_first_idx.accessor<int64_t, 1>();
|
||||||
auto dists_a = dists.accessor<float, 1>();
|
auto dists_a = dists.accessor<float, 1>();
|
||||||
@@ -230,10 +230,10 @@ std::tuple<at::Tensor, at::Tensor> HullHullDistanceBackwardCpu(
|
|||||||
at::Tensor grad_as = at::zeros_like(as);
|
at::Tensor grad_as = at::zeros_like(as);
|
||||||
at::Tensor grad_bs = at::zeros_like(bs);
|
at::Tensor grad_bs = at::zeros_like(bs);
|
||||||
|
|
||||||
auto as_a = as.accessor < float, H1 == 1 ? 2 : 3 > ();
|
auto as_a = as.accessor<float, H1 == 1 ? 2 : 3>();
|
||||||
auto bs_a = bs.accessor < float, H2 == 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_as_a = grad_as.accessor<float, H1 == 1 ? 2 : 3>();
|
||||||
auto grad_bs_a = grad_bs.accessor < float, H2 == 1 ? 2 : 3 > ();
|
auto grad_bs_a = grad_bs.accessor<float, H2 == 1 ? 2 : 3>();
|
||||||
auto idx_bs_a = idx_bs.accessor<int64_t, 1>();
|
auto idx_bs_a = idx_bs.accessor<int64_t, 1>();
|
||||||
auto grad_dists_a = grad_dists.accessor<float, 1>();
|
auto grad_dists_a = grad_dists.accessor<float, 1>();
|
||||||
|
|
||||||
|
|||||||
@@ -357,11 +357,11 @@ void MAX_WS(
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
#define END_PARALLEL() \
|
#define END_PARALLEL() \
|
||||||
end_parallel :; \
|
end_parallel:; \
|
||||||
}
|
}
|
||||||
#define END_PARALLEL_NORET() }
|
#define END_PARALLEL_NORET() }
|
||||||
#define END_PARALLEL_2D() \
|
#define END_PARALLEL_2D() \
|
||||||
end_parallel :; \
|
end_parallel:; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
#define END_PARALLEL_2D_NORET() \
|
#define END_PARALLEL_2D_NORET() \
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ HOST void construct(
|
|||||||
self->cam.film_width = width;
|
self->cam.film_width = width;
|
||||||
self->cam.film_height = height;
|
self->cam.film_height = height;
|
||||||
self->max_num_balls = max_num_balls;
|
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.orthogonal_projection = orthogonal_projection;
|
||||||
self->cam.right_handed = right_handed_system;
|
self->cam.right_handed = right_handed_system;
|
||||||
self->cam.background_normalization_depth = background_normalization_depth;
|
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->di_sorted_d, DrawInfo, max_num_balls);
|
||||||
MALLOC(self->region_flags_d, char, max_num_balls);
|
MALLOC(self->region_flags_d, char, max_num_balls);
|
||||||
MALLOC(self->num_selected_d, size_t, 1);
|
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->min_max_pixels_d, IntersectInfo, 1);
|
||||||
MALLOC(self->grad_pos_d, float3, max_num_balls);
|
MALLOC(self->grad_pos_d, float3, max_num_balls);
|
||||||
MALLOC(self->grad_col_d, float, max_num_balls* n_channels);
|
MALLOC(self->grad_col_d, float, max_num_balls* n_channels);
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ GLOBAL void calc_signature(
|
|||||||
* for every iteration through the loading loop every thread could add a
|
* for every iteration through the loading loop every thread could add a
|
||||||
* 'hit' to the buffer.
|
* '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
|
* The threshold after which the spheres that are in the render buffer
|
||||||
* are rendered and the buffer is flushed.
|
* are rendered and the buffer is flushed.
|
||||||
|
|||||||
@@ -99,8 +99,7 @@ namespace {
|
|||||||
// and increment it via template recursion until it is equal to the run-time
|
// and increment it via template recursion until it is equal to the run-time
|
||||||
// argument N.
|
// argument N.
|
||||||
template <
|
template <
|
||||||
template <typename, int64_t>
|
template <typename, int64_t> class Kernel,
|
||||||
class Kernel,
|
|
||||||
typename T,
|
typename T,
|
||||||
int64_t minN,
|
int64_t minN,
|
||||||
int64_t maxN,
|
int64_t maxN,
|
||||||
@@ -124,8 +123,7 @@ struct DispatchKernelHelper1D {
|
|||||||
// 1D dispatch: Specialization when curN == maxN
|
// 1D dispatch: Specialization when curN == maxN
|
||||||
// We need this base case to avoid infinite template recursion.
|
// We need this base case to avoid infinite template recursion.
|
||||||
template <
|
template <
|
||||||
template <typename, int64_t>
|
template <typename, int64_t> class Kernel,
|
||||||
class Kernel,
|
|
||||||
typename T,
|
typename T,
|
||||||
int64_t minN,
|
int64_t minN,
|
||||||
int64_t maxN,
|
int64_t maxN,
|
||||||
@@ -145,8 +143,7 @@ struct DispatchKernelHelper1D<Kernel, T, minN, maxN, maxN, Args...> {
|
|||||||
// the run-time values of N and M, at which point we dispatch to the run
|
// the run-time values of N and M, at which point we dispatch to the run
|
||||||
// method of the kernel.
|
// method of the kernel.
|
||||||
template <
|
template <
|
||||||
template <typename, int64_t, int64_t>
|
template <typename, int64_t, int64_t> class Kernel,
|
||||||
class Kernel,
|
|
||||||
typename T,
|
typename T,
|
||||||
int64_t minN,
|
int64_t minN,
|
||||||
int64_t maxN,
|
int64_t maxN,
|
||||||
@@ -203,8 +200,7 @@ struct DispatchKernelHelper2D {
|
|||||||
|
|
||||||
// 2D dispatch, specialization for curN == maxN
|
// 2D dispatch, specialization for curN == maxN
|
||||||
template <
|
template <
|
||||||
template <typename, int64_t, int64_t>
|
template <typename, int64_t, int64_t> class Kernel,
|
||||||
class Kernel,
|
|
||||||
typename T,
|
typename T,
|
||||||
int64_t minN,
|
int64_t minN,
|
||||||
int64_t maxN,
|
int64_t maxN,
|
||||||
@@ -243,8 +239,7 @@ struct DispatchKernelHelper2D<
|
|||||||
|
|
||||||
// 2D dispatch, specialization for curM == maxM
|
// 2D dispatch, specialization for curM == maxM
|
||||||
template <
|
template <
|
||||||
template <typename, int64_t, int64_t>
|
template <typename, int64_t, int64_t> class Kernel,
|
||||||
class Kernel,
|
|
||||||
typename T,
|
typename T,
|
||||||
int64_t minN,
|
int64_t minN,
|
||||||
int64_t maxN,
|
int64_t maxN,
|
||||||
@@ -283,8 +278,7 @@ struct DispatchKernelHelper2D<
|
|||||||
|
|
||||||
// 2D dispatch, specialization for curN == maxN, curM == maxM
|
// 2D dispatch, specialization for curN == maxN, curM == maxM
|
||||||
template <
|
template <
|
||||||
template <typename, int64_t, int64_t>
|
template <typename, int64_t, int64_t> class Kernel,
|
||||||
class Kernel,
|
|
||||||
typename T,
|
typename T,
|
||||||
int64_t minN,
|
int64_t minN,
|
||||||
int64_t maxN,
|
int64_t maxN,
|
||||||
@@ -313,8 +307,7 @@ struct DispatchKernelHelper2D<
|
|||||||
|
|
||||||
// This is the function we expect users to call to dispatch to 1D functions
|
// This is the function we expect users to call to dispatch to 1D functions
|
||||||
template <
|
template <
|
||||||
template <typename, int64_t>
|
template <typename, int64_t> class Kernel,
|
||||||
class Kernel,
|
|
||||||
typename T,
|
typename T,
|
||||||
int64_t minN,
|
int64_t minN,
|
||||||
int64_t maxN,
|
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
|
// This is the function we expect users to call to dispatch to 2D functions
|
||||||
template <
|
template <
|
||||||
template <typename, int64_t, int64_t>
|
template <typename, int64_t, int64_t> class Kernel,
|
||||||
class Kernel,
|
|
||||||
typename T,
|
typename T,
|
||||||
int64_t minN,
|
int64_t minN,
|
||||||
int64_t maxN,
|
int64_t maxN,
|
||||||
|
|||||||
Reference in New Issue
Block a user