diff --git a/pytorch3d/csrc/rasterize_meshes/rasterize_meshes.h b/pytorch3d/csrc/rasterize_meshes/rasterize_meshes.h index 584aa023..6731cc1b 100644 --- a/pytorch3d/csrc/rasterize_meshes/rasterize_meshes.h +++ b/pytorch3d/csrc/rasterize_meshes/rasterize_meshes.h @@ -138,6 +138,9 @@ RasterizeMeshesNaive( AT_ERROR("Not compiled with GPU support"); #endif } else { + CHECK_CPU(face_verts); + CHECK_CPU(mesh_to_face_first_idx); + CHECK_CPU(num_faces_per_mesh); return RasterizeMeshesNaiveCpu( face_verts, mesh_to_face_first_idx, @@ -232,6 +235,11 @@ torch::Tensor RasterizeMeshesBackward( AT_ERROR("Not compiled with GPU support"); #endif } else { + CHECK_CPU(face_verts); + CHECK_CPU(pix_to_face); + CHECK_CPU(grad_zbuf); + CHECK_CPU(grad_bary); + CHECK_CPU(grad_dists); return RasterizeMeshesBackwardCpu( face_verts, pix_to_face, @@ -306,6 +314,9 @@ torch::Tensor RasterizeMeshesCoarse( AT_ERROR("Not compiled with GPU support"); #endif } else { + CHECK_CPU(face_verts); + CHECK_CPU(mesh_to_face_first_idx); + CHECK_CPU(num_faces_per_mesh); return RasterizeMeshesCoarseCpu( face_verts, mesh_to_face_first_idx, @@ -423,6 +434,8 @@ RasterizeMeshesFine( AT_ERROR("Not compiled with GPU support"); #endif } else { + CHECK_CPU(face_verts); + CHECK_CPU(bin_faces); AT_ERROR("NOT IMPLEMENTED"); } } diff --git a/pytorch3d/csrc/rasterize_points/rasterize_points.h b/pytorch3d/csrc/rasterize_points/rasterize_points.h index 4e74e9e2..576aaa64 100644 --- a/pytorch3d/csrc/rasterize_points/rasterize_points.h +++ b/pytorch3d/csrc/rasterize_points/rasterize_points.h @@ -91,6 +91,10 @@ std::tuple RasterizePointsNaive( AT_ERROR("Not compiled with GPU support"); #endif } else { + CHECK_CPU(points); + CHECK_CPU(cloud_to_packed_first_idx); + CHECK_CPU(num_points_per_cloud); + CHECK_CPU(radius); return RasterizePointsNaiveCpu( points, cloud_to_packed_first_idx, @@ -166,6 +170,10 @@ torch::Tensor RasterizePointsCoarse( AT_ERROR("Not compiled with GPU support"); #endif } else { + CHECK_CPU(points); + CHECK_CPU(cloud_to_packed_first_idx); + CHECK_CPU(num_points_per_cloud); + CHECK_CPU(radius); return RasterizePointsCoarseCpu( points, cloud_to_packed_first_idx, @@ -232,6 +240,8 @@ std::tuple RasterizePointsFine( AT_ERROR("Not compiled with GPU support"); #endif } else { + CHECK_CPU(points); + CHECK_CPU(bin_points); AT_ERROR("NOT IMPLEMENTED"); } } @@ -284,6 +294,10 @@ torch::Tensor RasterizePointsBackward( AT_ERROR("Not compiled with GPU support"); #endif } else { + CHECK_CPU(points); + CHECK_CPU(idxs); + CHECK_CPU(grad_zbuf); + CHECK_CPU(grad_dists); return RasterizePointsBackwardCpu(points, idxs, grad_zbuf, grad_dists); } } diff --git a/pytorch3d/csrc/sample_farthest_points/sample_farthest_points.h b/pytorch3d/csrc/sample_farthest_points/sample_farthest_points.h index 7b613d35..a44a0a81 100644 --- a/pytorch3d/csrc/sample_farthest_points/sample_farthest_points.h +++ b/pytorch3d/csrc/sample_farthest_points/sample_farthest_points.h @@ -68,5 +68,9 @@ at::Tensor FarthestPointSampling( AT_ERROR("Not compiled with GPU support."); #endif } + CHECK_CPU(points); + CHECK_CPU(lengths); + CHECK_CPU(K); + CHECK_CPU(start_idxs); return FarthestPointSamplingCpu(points, lengths, K, start_idxs); } diff --git a/pytorch3d/csrc/sample_pdf/sample_pdf.h b/pytorch3d/csrc/sample_pdf/sample_pdf.h index 899117df..a3697053 100644 --- a/pytorch3d/csrc/sample_pdf/sample_pdf.h +++ b/pytorch3d/csrc/sample_pdf/sample_pdf.h @@ -71,6 +71,8 @@ inline void SamplePdf( AT_ERROR("Not compiled with GPU support."); #endif } + CHECK_CPU(weights); + CHECK_CPU(outputs); CHECK_CONTIGUOUS(outputs); SamplePdfCpu(bins, weights, outputs, eps); }