From 21205730d9214768d9076e48147433818f0bb58e Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Sat, 8 Mar 2025 13:03:17 -0800 Subject: [PATCH] Fix unused-variable issues, mostly relating to AMD/HIP Reviewed By: meyering Differential Revision: D70845538 fbshipit-source-id: 8e52b5e1f1d96b86404fc3b8cbc6fb952e2cb1a6 --- pytorch3d/csrc/compositing/alpha_composite.cu | 2 -- pytorch3d/csrc/compositing/norm_weighted_sum.cu | 2 -- pytorch3d/csrc/compositing/weighted_sum.cu | 2 -- pytorch3d/csrc/iou_box3d/iou_utils.cuh | 3 --- .../csrc/sample_farthest_points/sample_farthest_points.cu | 2 -- pytorch3d/csrc/utils/geometry_utils.cuh | 2 -- 6 files changed, 13 deletions(-) diff --git a/pytorch3d/csrc/compositing/alpha_composite.cu b/pytorch3d/csrc/compositing/alpha_composite.cu index 679d8a82..b5d512e8 100644 --- a/pytorch3d/csrc/compositing/alpha_composite.cu +++ b/pytorch3d/csrc/compositing/alpha_composite.cu @@ -28,7 +28,6 @@ __global__ void alphaCompositeCudaForwardKernel( const at::PackedTensorAccessor64 alphas, const at::PackedTensorAccessor64 points_idx) { // clang-format on - const int64_t batch_size = result.size(0); const int64_t C = features.size(0); const int64_t H = points_idx.size(2); const int64_t W = points_idx.size(3); @@ -79,7 +78,6 @@ __global__ void alphaCompositeCudaBackwardKernel( const at::PackedTensorAccessor64 alphas, const at::PackedTensorAccessor64 points_idx) { // clang-format on - const int64_t batch_size = points_idx.size(0); const int64_t C = features.size(0); const int64_t H = points_idx.size(2); const int64_t W = points_idx.size(3); diff --git a/pytorch3d/csrc/compositing/norm_weighted_sum.cu b/pytorch3d/csrc/compositing/norm_weighted_sum.cu index 98464717..455bdb7f 100644 --- a/pytorch3d/csrc/compositing/norm_weighted_sum.cu +++ b/pytorch3d/csrc/compositing/norm_weighted_sum.cu @@ -28,7 +28,6 @@ __global__ void weightedSumNormCudaForwardKernel( const at::PackedTensorAccessor64 alphas, const at::PackedTensorAccessor64 points_idx) { // clang-format on - const int64_t batch_size = result.size(0); const int64_t C = features.size(0); const int64_t H = points_idx.size(2); const int64_t W = points_idx.size(3); @@ -92,7 +91,6 @@ __global__ void weightedSumNormCudaBackwardKernel( const at::PackedTensorAccessor64 alphas, const at::PackedTensorAccessor64 points_idx) { // clang-format on - const int64_t batch_size = points_idx.size(0); const int64_t C = features.size(0); const int64_t H = points_idx.size(2); const int64_t W = points_idx.size(3); diff --git a/pytorch3d/csrc/compositing/weighted_sum.cu b/pytorch3d/csrc/compositing/weighted_sum.cu index 17a35bf9..125688a1 100644 --- a/pytorch3d/csrc/compositing/weighted_sum.cu +++ b/pytorch3d/csrc/compositing/weighted_sum.cu @@ -26,7 +26,6 @@ __global__ void weightedSumCudaForwardKernel( const at::PackedTensorAccessor64 alphas, const at::PackedTensorAccessor64 points_idx) { // clang-format on - const int64_t batch_size = result.size(0); const int64_t C = features.size(0); const int64_t H = points_idx.size(2); const int64_t W = points_idx.size(3); @@ -74,7 +73,6 @@ __global__ void weightedSumCudaBackwardKernel( const at::PackedTensorAccessor64 alphas, const at::PackedTensorAccessor64 points_idx) { // clang-format on - const int64_t batch_size = points_idx.size(0); const int64_t C = features.size(0); const int64_t H = points_idx.size(2); const int64_t W = points_idx.size(3); diff --git a/pytorch3d/csrc/iou_box3d/iou_utils.cuh b/pytorch3d/csrc/iou_box3d/iou_utils.cuh index c4a1f5c9..1d702069 100644 --- a/pytorch3d/csrc/iou_box3d/iou_utils.cuh +++ b/pytorch3d/csrc/iou_box3d/iou_utils.cuh @@ -461,10 +461,8 @@ __device__ inline std::tuple ArgMaxVerts( __device__ inline bool IsCoplanarTriTri( const FaceVerts& tri1, const FaceVerts& tri2) { - const float3 tri1_ctr = FaceCenter({tri1.v0, tri1.v1, tri1.v2}); const float3 tri1_n = FaceNormal({tri1.v0, tri1.v1, tri1.v2}); - const float3 tri2_ctr = FaceCenter({tri2.v0, tri2.v1, tri2.v2}); const float3 tri2_n = FaceNormal({tri2.v0, tri2.v1, tri2.v2}); // Check if parallel @@ -500,7 +498,6 @@ __device__ inline bool IsCoplanarTriPlane( const FaceVerts& tri, const FaceVerts& plane, const float3& normal) { - const float3 tri_ctr = FaceCenter({tri.v0, tri.v1, tri.v2}); const float3 nt = FaceNormal({tri.v0, tri.v1, tri.v2}); // check if parallel diff --git a/pytorch3d/csrc/sample_farthest_points/sample_farthest_points.cu b/pytorch3d/csrc/sample_farthest_points/sample_farthest_points.cu index 70cef75c..a0b84dd4 100644 --- a/pytorch3d/csrc/sample_farthest_points/sample_farthest_points.cu +++ b/pytorch3d/csrc/sample_farthest_points/sample_farthest_points.cu @@ -35,8 +35,6 @@ __global__ void FarthestPointSamplingKernel( __shared__ int64_t selected_store; // Get constants - const int64_t N = points.size(0); - const int64_t P = points.size(1); const int64_t D = points.size(2); // Get batch index and thread index diff --git a/pytorch3d/csrc/utils/geometry_utils.cuh b/pytorch3d/csrc/utils/geometry_utils.cuh index 66aee7fc..b18bb542 100644 --- a/pytorch3d/csrc/utils/geometry_utils.cuh +++ b/pytorch3d/csrc/utils/geometry_utils.cuh @@ -376,8 +376,6 @@ PointLineDistanceBackward( float tt = t_top / t_bot; tt = __saturatef(tt); const float2 p_proj = (1.0f - tt) * v0 + tt * v1; - const float2 d = p - p_proj; - const float dist = sqrt(dot(d, d)); const float2 grad_p = -1.0f * grad_dist * 2.0f * (p_proj - p); const float2 grad_v0 = grad_dist * (1.0f - tt) * 2.0f * (p_proj - p);