Skip to content

Commit 1e81791

Browse files
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
1 parent 799c1cd commit 1e81791

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch3d/csrc/knn/knn.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ __global__ void KNearestNeighborBackwardKernel(
495495
if ((p1_idx < num1) && (k < num2)) {
496496
const float grad_dist = grad_dists[n * P1 * K + p1_idx * K + k];
497497
// index of point in p2 corresponding to the k-th nearest neighbor
498-
const size_t p2_idx = idxs[n * P1 * K + p1_idx * K + k];
498+
const int64_t p2_idx = idxs[n * P1 * K + p1_idx * K + k];
499499
// If the index is the pad value of -1 then ignore it
500500
if (p2_idx == -1) {
501501
continue;

0 commit comments

Comments
 (0)