From 1e817914b37e5af014ed890648777a19afce3d51 Mon Sep 17 00:00:00 2001 From: Dimitris Prountzos Date: Thu, 18 Jan 2024 12:27:16 -0800 Subject: [PATCH] Fix compiler warning in knn.ku Summary: This change updates the type of p2_idx from size_t to int64_t to address compiler warnings related to signed/unsigned comparison. Reviewed By: bottler Differential Revision: D52879393 fbshipit-source-id: de5484d78a907fccdaae3ce036b5e4a1a0a4de70 --- pytorch3d/csrc/knn/knn.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch3d/csrc/knn/knn.cu b/pytorch3d/csrc/knn/knn.cu index 779fcbf1..93a3060b 100644 --- a/pytorch3d/csrc/knn/knn.cu +++ b/pytorch3d/csrc/knn/knn.cu @@ -495,7 +495,7 @@ __global__ void KNearestNeighborBackwardKernel( if ((p1_idx < num1) && (k < num2)) { const float grad_dist = grad_dists[n * P1 * K + p1_idx * K + k]; // index of point in p2 corresponding to the k-th nearest neighbor - const size_t p2_idx = idxs[n * P1 * K + p1_idx * K + k]; + const int64_t p2_idx = idxs[n * P1 * K + p1_idx * K + k]; // If the index is the pad value of -1 then ignore it if (p2_idx == -1) { continue;