@@ -88,6 +88,10 @@ std::tuple<torch::Tensor, torch::Tensor> PointFaceDistanceForward(
8888 AT_ERROR (" Not compiled with GPU support." );
8989#endif
9090 }
91+ CHECK_CPU (points);
92+ CHECK_CPU (points_first_idx);
93+ CHECK_CPU (tris);
94+ CHECK_CPU (tris_first_idx);
9195 return PointFaceDistanceForwardCpu (
9296 points, points_first_idx, tris, tris_first_idx, min_triangle_area);
9397}
@@ -143,6 +147,10 @@ std::tuple<torch::Tensor, torch::Tensor> PointFaceDistanceBackward(
143147 AT_ERROR (" Not compiled with GPU support." );
144148#endif
145149 }
150+ CHECK_CPU (points);
151+ CHECK_CPU (tris);
152+ CHECK_CPU (idx_points);
153+ CHECK_CPU (grad_dists);
146154 return PointFaceDistanceBackwardCpu (
147155 points, tris, idx_points, grad_dists, min_triangle_area);
148156}
@@ -221,6 +229,10 @@ std::tuple<torch::Tensor, torch::Tensor> FacePointDistanceForward(
221229 AT_ERROR (" Not compiled with GPU support." );
222230#endif
223231 }
232+ CHECK_CPU (points);
233+ CHECK_CPU (points_first_idx);
234+ CHECK_CPU (tris);
235+ CHECK_CPU (tris_first_idx);
224236 return FacePointDistanceForwardCpu (
225237 points, points_first_idx, tris, tris_first_idx, min_triangle_area);
226238}
@@ -277,6 +289,10 @@ std::tuple<torch::Tensor, torch::Tensor> FacePointDistanceBackward(
277289 AT_ERROR (" Not compiled with GPU support." );
278290#endif
279291 }
292+ CHECK_CPU (points);
293+ CHECK_CPU (tris);
294+ CHECK_CPU (idx_tris);
295+ CHECK_CPU (grad_dists);
280296 return FacePointDistanceBackwardCpu (
281297 points, tris, idx_tris, grad_dists, min_triangle_area);
282298}
@@ -346,6 +362,10 @@ std::tuple<torch::Tensor, torch::Tensor> PointEdgeDistanceForward(
346362 AT_ERROR (" Not compiled with GPU support." );
347363#endif
348364 }
365+ CHECK_CPU (points);
366+ CHECK_CPU (points_first_idx);
367+ CHECK_CPU (segms);
368+ CHECK_CPU (segms_first_idx);
349369 return PointEdgeDistanceForwardCpu (
350370 points, points_first_idx, segms, segms_first_idx, max_points);
351371}
@@ -396,6 +416,10 @@ std::tuple<torch::Tensor, torch::Tensor> PointEdgeDistanceBackward(
396416 AT_ERROR (" Not compiled with GPU support." );
397417#endif
398418 }
419+ CHECK_CPU (points);
420+ CHECK_CPU (segms);
421+ CHECK_CPU (idx_points);
422+ CHECK_CPU (grad_dists);
399423 return PointEdgeDistanceBackwardCpu (points, segms, idx_points, grad_dists);
400424}
401425
@@ -464,6 +488,10 @@ std::tuple<torch::Tensor, torch::Tensor> EdgePointDistanceForward(
464488 AT_ERROR (" Not compiled with GPU support." );
465489#endif
466490 }
491+ CHECK_CPU (points);
492+ CHECK_CPU (points_first_idx);
493+ CHECK_CPU (segms);
494+ CHECK_CPU (segms_first_idx);
467495 return EdgePointDistanceForwardCpu (
468496 points, points_first_idx, segms, segms_first_idx, max_segms);
469497}
@@ -514,6 +542,10 @@ std::tuple<torch::Tensor, torch::Tensor> EdgePointDistanceBackward(
514542 AT_ERROR (" Not compiled with GPU support." );
515543#endif
516544 }
545+ CHECK_CPU (points);
546+ CHECK_CPU (segms);
547+ CHECK_CPU (idx_segms);
548+ CHECK_CPU (grad_dists);
517549 return EdgePointDistanceBackwardCpu (points, segms, idx_segms, grad_dists);
518550}
519551
@@ -567,6 +599,8 @@ torch::Tensor PointFaceArrayDistanceForward(
567599 AT_ERROR (" Not compiled with GPU support." );
568600#endif
569601 }
602+ CHECK_CPU (points);
603+ CHECK_CPU (tris);
570604 return PointFaceArrayDistanceForwardCpu (points, tris, min_triangle_area);
571605}
572606
@@ -613,6 +647,9 @@ std::tuple<torch::Tensor, torch::Tensor> PointFaceArrayDistanceBackward(
613647 AT_ERROR (" Not compiled with GPU support." );
614648#endif
615649 }
650+ CHECK_CPU (points);
651+ CHECK_CPU (tris);
652+ CHECK_CPU (grad_dists);
616653 return PointFaceArrayDistanceBackwardCpu (
617654 points, tris, grad_dists, min_triangle_area);
618655}
@@ -661,6 +698,8 @@ torch::Tensor PointEdgeArrayDistanceForward(
661698 AT_ERROR (" Not compiled with GPU support." );
662699#endif
663700 }
701+ CHECK_CPU (points);
702+ CHECK_CPU (segms);
664703 return PointEdgeArrayDistanceForwardCpu (points, segms);
665704}
666705
@@ -703,5 +742,8 @@ std::tuple<torch::Tensor, torch::Tensor> PointEdgeArrayDistanceBackward(
703742 AT_ERROR (" Not compiled with GPU support." );
704743#endif
705744 }
745+ CHECK_CPU (points);
746+ CHECK_CPU (segms);
747+ CHECK_CPU (grad_dists);
706748 return PointEdgeArrayDistanceBackwardCpu (points, segms, grad_dists);
707749}
0 commit comments