Skip to content

Commit 45df20e

Browse files
nlutsenkometa-codesync[bot]
authored andcommitted
clang-format | Format fbsource with clang-format 21.
Reviewed By: ChristianK275 Differential Revision: D85317706 fbshipit-source-id: b399c5c4b75252999442b7d7d2778e7a241b0025
1 parent fc6a6b8 commit 45df20e

File tree

6 files changed

+29
-36
lines changed

6 files changed

+29
-36
lines changed

pytorch3d/csrc/ext.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,16 @@ PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
105105
py::class_<
106106
pulsar::pytorch::Renderer,
107107
std::shared_ptr<pulsar::pytorch::Renderer>>(m, "PulsarRenderer")
108-
.def(py::init<
109-
const uint&,
110-
const uint&,
111-
const uint&,
112-
const bool&,
113-
const bool&,
114-
const float&,
115-
const uint&,
116-
const uint&>())
108+
.def(
109+
py::init<
110+
const uint&,
111+
const uint&,
112+
const uint&,
113+
const bool&,
114+
const bool&,
115+
const float&,
116+
const uint&,
117+
const uint&>())
117118
.def(
118119
"__eq__",
119120
[](const pulsar::pytorch::Renderer& a,

pytorch3d/csrc/point_mesh/point_mesh_cpu.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ std::tuple<at::Tensor, at::Tensor> HullHullDistanceForwardCpu(
174174
at::Tensor idxs = at::zeros({A_N,}, as_first_idx.options());
175175
// clang-format on
176176

177-
auto as_a = as.accessor < float, H1 == 1 ? 2 : 3 > ();
178-
auto bs_a = bs.accessor < float, H2 == 1 ? 2 : 3 > ();
177+
auto as_a = as.accessor<float, H1 == 1 ? 2 : 3>();
178+
auto bs_a = bs.accessor<float, H2 == 1 ? 2 : 3>();
179179
auto as_first_idx_a = as_first_idx.accessor<int64_t, 1>();
180180
auto bs_first_idx_a = bs_first_idx.accessor<int64_t, 1>();
181181
auto dists_a = dists.accessor<float, 1>();
@@ -230,10 +230,10 @@ std::tuple<at::Tensor, at::Tensor> HullHullDistanceBackwardCpu(
230230
at::Tensor grad_as = at::zeros_like(as);
231231
at::Tensor grad_bs = at::zeros_like(bs);
232232

233-
auto as_a = as.accessor < float, H1 == 1 ? 2 : 3 > ();
234-
auto bs_a = bs.accessor < float, H2 == 1 ? 2 : 3 > ();
235-
auto grad_as_a = grad_as.accessor < float, H1 == 1 ? 2 : 3 > ();
236-
auto grad_bs_a = grad_bs.accessor < float, H2 == 1 ? 2 : 3 > ();
233+
auto as_a = as.accessor<float, H1 == 1 ? 2 : 3>();
234+
auto bs_a = bs.accessor<float, H2 == 1 ? 2 : 3>();
235+
auto grad_as_a = grad_as.accessor<float, H1 == 1 ? 2 : 3>();
236+
auto grad_bs_a = grad_bs.accessor<float, H2 == 1 ? 2 : 3>();
237237
auto idx_bs_a = idx_bs.accessor<int64_t, 1>();
238238
auto grad_dists_a = grad_dists.accessor<float, 1>();
239239

pytorch3d/csrc/pulsar/host/commands.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,11 @@ void MAX_WS(
357357
//
358358
//
359359
#define END_PARALLEL() \
360-
end_parallel :; \
360+
end_parallel:; \
361361
}
362362
#define END_PARALLEL_NORET() }
363363
#define END_PARALLEL_2D() \
364-
end_parallel :; \
364+
end_parallel:; \
365365
} \
366366
}
367367
#define END_PARALLEL_2D_NORET() \

pytorch3d/csrc/pulsar/include/renderer.construct.device.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ HOST void construct(
5252
self->cam.film_width = width;
5353
self->cam.film_height = height;
5454
self->max_num_balls = max_num_balls;
55-
MALLOC(self->result_d, float, width* height* n_channels);
55+
MALLOC(self->result_d, float, width * height * n_channels);
5656
self->cam.orthogonal_projection = orthogonal_projection;
5757
self->cam.right_handed = right_handed_system;
5858
self->cam.background_normalization_depth = background_normalization_depth;
@@ -93,7 +93,7 @@ HOST void construct(
9393
MALLOC(self->di_sorted_d, DrawInfo, max_num_balls);
9494
MALLOC(self->region_flags_d, char, max_num_balls);
9595
MALLOC(self->num_selected_d, size_t, 1);
96-
MALLOC(self->forw_info_d, float, width* height * (3 + 2 * n_track));
96+
MALLOC(self->forw_info_d, float, width * height * (3 + 2 * n_track));
9797
MALLOC(self->min_max_pixels_d, IntersectInfo, 1);
9898
MALLOC(self->grad_pos_d, float3, max_num_balls);
9999
MALLOC(self->grad_col_d, float, max_num_balls* n_channels);

pytorch3d/csrc/pulsar/include/renderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ GLOBAL void calc_signature(
255255
* for every iteration through the loading loop every thread could add a
256256
* 'hit' to the buffer.
257257
*/
258-
#define RENDER_BUFFER_SIZE RENDER_BLOCK_SIZE* RENDER_BLOCK_SIZE * 2
258+
#define RENDER_BUFFER_SIZE RENDER_BLOCK_SIZE * RENDER_BLOCK_SIZE * 2
259259
/**
260260
* The threshold after which the spheres that are in the render buffer
261261
* are rendered and the buffer is flushed.

pytorch3d/csrc/utils/dispatch.cuh

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ namespace {
9999
// and increment it via template recursion until it is equal to the run-time
100100
// argument N.
101101
template <
102-
template <typename, int64_t>
103-
class Kernel,
102+
template <typename, int64_t> class Kernel,
104103
typename T,
105104
int64_t minN,
106105
int64_t maxN,
@@ -124,8 +123,7 @@ struct DispatchKernelHelper1D {
124123
// 1D dispatch: Specialization when curN == maxN
125124
// We need this base case to avoid infinite template recursion.
126125
template <
127-
template <typename, int64_t>
128-
class Kernel,
126+
template <typename, int64_t> class Kernel,
129127
typename T,
130128
int64_t minN,
131129
int64_t maxN,
@@ -145,8 +143,7 @@ struct DispatchKernelHelper1D<Kernel, T, minN, maxN, maxN, Args...> {
145143
// the run-time values of N and M, at which point we dispatch to the run
146144
// method of the kernel.
147145
template <
148-
template <typename, int64_t, int64_t>
149-
class Kernel,
146+
template <typename, int64_t, int64_t> class Kernel,
150147
typename T,
151148
int64_t minN,
152149
int64_t maxN,
@@ -203,8 +200,7 @@ struct DispatchKernelHelper2D {
203200

204201
// 2D dispatch, specialization for curN == maxN
205202
template <
206-
template <typename, int64_t, int64_t>
207-
class Kernel,
203+
template <typename, int64_t, int64_t> class Kernel,
208204
typename T,
209205
int64_t minN,
210206
int64_t maxN,
@@ -243,8 +239,7 @@ struct DispatchKernelHelper2D<
243239

244240
// 2D dispatch, specialization for curM == maxM
245241
template <
246-
template <typename, int64_t, int64_t>
247-
class Kernel,
242+
template <typename, int64_t, int64_t> class Kernel,
248243
typename T,
249244
int64_t minN,
250245
int64_t maxN,
@@ -283,8 +278,7 @@ struct DispatchKernelHelper2D<
283278

284279
// 2D dispatch, specialization for curN == maxN, curM == maxM
285280
template <
286-
template <typename, int64_t, int64_t>
287-
class Kernel,
281+
template <typename, int64_t, int64_t> class Kernel,
288282
typename T,
289283
int64_t minN,
290284
int64_t maxN,
@@ -313,8 +307,7 @@ struct DispatchKernelHelper2D<
313307

314308
// This is the function we expect users to call to dispatch to 1D functions
315309
template <
316-
template <typename, int64_t>
317-
class Kernel,
310+
template <typename, int64_t> class Kernel,
318311
typename T,
319312
int64_t minN,
320313
int64_t maxN,
@@ -330,8 +323,7 @@ void DispatchKernel1D(const int64_t N, Args... args) {
330323

331324
// This is the function we expect users to call to dispatch to 2D functions
332325
template <
333-
template <typename, int64_t, int64_t>
334-
class Kernel,
326+
template <typename, int64_t, int64_t> class Kernel,
335327
typename T,
336328
int64_t minN,
337329
int64_t maxN,

0 commit comments

Comments
 (0)