Skip to content

Commit 2120573

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix unused-variable issues, mostly relating to AMD/HIP
Reviewed By: meyering Differential Revision: D70845538 fbshipit-source-id: 8e52b5e1f1d96b86404fc3b8cbc6fb952e2cb1a6
1 parent 7e09505 commit 2120573

File tree

6 files changed

+0
-13
lines changed

6 files changed

+0
-13
lines changed

pytorch3d/csrc/compositing/alpha_composite.cu

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ __global__ void alphaCompositeCudaForwardKernel(
2828
const at::PackedTensorAccessor64<float, 4, at::RestrictPtrTraits> alphas,
2929
const at::PackedTensorAccessor64<int64_t, 4, at::RestrictPtrTraits> points_idx) {
3030
// clang-format on
31-
const int64_t batch_size = result.size(0);
3231
const int64_t C = features.size(0);
3332
const int64_t H = points_idx.size(2);
3433
const int64_t W = points_idx.size(3);
@@ -79,7 +78,6 @@ __global__ void alphaCompositeCudaBackwardKernel(
7978
const at::PackedTensorAccessor64<float, 4, at::RestrictPtrTraits> alphas,
8079
const at::PackedTensorAccessor64<int64_t, 4, at::RestrictPtrTraits> points_idx) {
8180
// clang-format on
82-
const int64_t batch_size = points_idx.size(0);
8381
const int64_t C = features.size(0);
8482
const int64_t H = points_idx.size(2);
8583
const int64_t W = points_idx.size(3);

pytorch3d/csrc/compositing/norm_weighted_sum.cu

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ __global__ void weightedSumNormCudaForwardKernel(
2828
const at::PackedTensorAccessor64<float, 4, at::RestrictPtrTraits> alphas,
2929
const at::PackedTensorAccessor64<int64_t, 4, at::RestrictPtrTraits> points_idx) {
3030
// clang-format on
31-
const int64_t batch_size = result.size(0);
3231
const int64_t C = features.size(0);
3332
const int64_t H = points_idx.size(2);
3433
const int64_t W = points_idx.size(3);
@@ -92,7 +91,6 @@ __global__ void weightedSumNormCudaBackwardKernel(
9291
const at::PackedTensorAccessor64<float, 4, at::RestrictPtrTraits> alphas,
9392
const at::PackedTensorAccessor64<int64_t, 4, at::RestrictPtrTraits> points_idx) {
9493
// clang-format on
95-
const int64_t batch_size = points_idx.size(0);
9694
const int64_t C = features.size(0);
9795
const int64_t H = points_idx.size(2);
9896
const int64_t W = points_idx.size(3);

pytorch3d/csrc/compositing/weighted_sum.cu

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ __global__ void weightedSumCudaForwardKernel(
2626
const at::PackedTensorAccessor64<float, 4, at::RestrictPtrTraits> alphas,
2727
const at::PackedTensorAccessor64<int64_t, 4, at::RestrictPtrTraits> points_idx) {
2828
// clang-format on
29-
const int64_t batch_size = result.size(0);
3029
const int64_t C = features.size(0);
3130
const int64_t H = points_idx.size(2);
3231
const int64_t W = points_idx.size(3);
@@ -74,7 +73,6 @@ __global__ void weightedSumCudaBackwardKernel(
7473
const at::PackedTensorAccessor64<float, 4, at::RestrictPtrTraits> alphas,
7574
const at::PackedTensorAccessor64<int64_t, 4, at::RestrictPtrTraits> points_idx) {
7675
// clang-format on
77-
const int64_t batch_size = points_idx.size(0);
7876
const int64_t C = features.size(0);
7977
const int64_t H = points_idx.size(2);
8078
const int64_t W = points_idx.size(3);

pytorch3d/csrc/iou_box3d/iou_utils.cuh

-3
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,8 @@ __device__ inline std::tuple<float3, float3> ArgMaxVerts(
461461
__device__ inline bool IsCoplanarTriTri(
462462
const FaceVerts& tri1,
463463
const FaceVerts& tri2) {
464-
const float3 tri1_ctr = FaceCenter({tri1.v0, tri1.v1, tri1.v2});
465464
const float3 tri1_n = FaceNormal({tri1.v0, tri1.v1, tri1.v2});
466465

467-
const float3 tri2_ctr = FaceCenter({tri2.v0, tri2.v1, tri2.v2});
468466
const float3 tri2_n = FaceNormal({tri2.v0, tri2.v1, tri2.v2});
469467

470468
// Check if parallel
@@ -500,7 +498,6 @@ __device__ inline bool IsCoplanarTriPlane(
500498
const FaceVerts& tri,
501499
const FaceVerts& plane,
502500
const float3& normal) {
503-
const float3 tri_ctr = FaceCenter({tri.v0, tri.v1, tri.v2});
504501
const float3 nt = FaceNormal({tri.v0, tri.v1, tri.v2});
505502

506503
// check if parallel

pytorch3d/csrc/sample_farthest_points/sample_farthest_points.cu

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ __global__ void FarthestPointSamplingKernel(
3535
__shared__ int64_t selected_store;
3636

3737
// Get constants
38-
const int64_t N = points.size(0);
39-
const int64_t P = points.size(1);
4038
const int64_t D = points.size(2);
4139

4240
// Get batch index and thread index

pytorch3d/csrc/utils/geometry_utils.cuh

-2
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,6 @@ PointLineDistanceBackward(
376376
float tt = t_top / t_bot;
377377
tt = __saturatef(tt);
378378
const float2 p_proj = (1.0f - tt) * v0 + tt * v1;
379-
const float2 d = p - p_proj;
380-
const float dist = sqrt(dot(d, d));
381379

382380
const float2 grad_p = -1.0f * grad_dist * 2.0f * (p_proj - p);
383381
const float2 grad_v0 = grad_dist * (1.0f - tt) * 2.0f * (p_proj - p);

0 commit comments

Comments
 (0)