mirror of
https://github.com/wassname/Pointnet2_PyTorch.git
synced 2026-07-23 12:40:28 +08:00
Initial commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#include <THC/THC.h>
|
||||
|
||||
#include "group_points_gpu.h"
|
||||
|
||||
extern THCState *state;
|
||||
|
||||
int group_points_wrapper(int b, int n, int c, int npoints, int nsample,
|
||||
THCudaTensor *points_tensor,
|
||||
THCudaIntTensor *idx_tensor,
|
||||
THCudaTensor *out_tensor) {
|
||||
|
||||
const float *points = THCudaTensor_data(state, points_tensor);
|
||||
const int *idx = THCudaIntTensor_data(state, idx_tensor);
|
||||
float *out = THCudaTensor_data(state, out_tensor);
|
||||
|
||||
cudaStream_t stream = THCState_getCurrentStream(state);
|
||||
|
||||
group_points_kernel_wrapper(b, n, c, npoints, nsample, points, idx, out,
|
||||
stream);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int group_points_grad_wrapper(int b, int n, int c, int npoints, int nsample,
|
||||
THCudaTensor *grad_out_tensor,
|
||||
THCudaIntTensor *idx_tensor,
|
||||
THCudaTensor *grad_points_tensor) {
|
||||
|
||||
float *grad_points = THCudaTensor_data(state, grad_points_tensor);
|
||||
const int *idx = THCudaIntTensor_data(state, idx_tensor);
|
||||
const float *grad_out = THCudaTensor_data(state, grad_out_tensor);
|
||||
|
||||
cudaStream_t stream = THCState_getCurrentStream(state);
|
||||
|
||||
group_points_grad_kernel_wrapper(b, n, c, npoints, nsample, grad_out,
|
||||
idx, grad_points, stream);
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user