#include #include #include // #include #include "sampling_gpu.h" // extern THCState *state; #include #include // cudaStream_t stream = at::cuda::getCurrentCUDAStream(); int gather_points_wrapper_fast(int b, int c, int n, int npoints, at::Tensor points_tensor, at::Tensor idx_tensor, at::Tensor out_tensor){ const float *points = points_tensor.data(); const int *idx = idx_tensor.data(); float *out = out_tensor.data(); gather_points_kernel_launcher_fast(b, c, n, npoints, points, idx, out); return 1; } int gather_points_grad_wrapper_fast(int b, int c, int n, int npoints, at::Tensor grad_out_tensor, at::Tensor idx_tensor, at::Tensor grad_points_tensor) { const float *grad_out = grad_out_tensor.data(); const int *idx = idx_tensor.data(); float *grad_points = grad_points_tensor.data(); gather_points_grad_kernel_launcher_fast(b, c, n, npoints, grad_out, idx, grad_points); return 1; } int furthest_point_sampling_wrapper(int b, int c, int n, int m, float w1, float w2, at::Tensor points_tensor, at::Tensor temp_tensor, at::Tensor idx_tensor) { const float *points = points_tensor.data(); float *temp = temp_tensor.data(); int *idx = idx_tensor.data(); furthest_point_sampling_kernel_launcher(b, c, n, m, w1, w2, points, temp, idx); return 1; }