Initial commit

This commit is contained in:
erikwijmans
2017-12-26 18:43:17 -05:00
commit dc4e2b0db3
42 changed files with 3486 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#ifndef _BALL_QUERY_GPU
#define _BALL_QUERY_GPU
#ifdef __cplusplus
extern "C" {
#endif
void query_ball_point_kernel_wrapper(int b, int n, int m, float radius,
int nsample, const float *xyz,
const float *new_xyz, int *idx,
cudaStream_t stream);
#ifdef __cplusplus
}
#endif
#endif
+4
View File
@@ -0,0 +1,4 @@
int ball_query_wrapper(int b, int n, int m, float radius, int nsample,
THCudaTensor *new_xyz_tensor, THCudaTensor *xyz_tensor,
THCudaIntTensor *idx_tensor);
+24
View File
@@ -0,0 +1,24 @@
#ifndef _CUDA_UTILS_H
#define _CUDA_UTILS_H
#ifdef __cplusplus
extern "C" {
#endif
inline int opt_n_threads(int work_size) {
unsigned int n_threads = work_size;
n_threads--;
n_threads |= n_threads >> 1;
n_threads |= n_threads >> 2;
n_threads |= n_threads >> 4;
n_threads |= n_threads >> 8;
n_threads |= n_threads >> 16;
n_threads++;
return max(min(n_threads / 2, 512), 2);
}
#ifdef __cplusplus
}
#endif
#endif
+19
View File
@@ -0,0 +1,19 @@
#ifndef _BALL_QUERY_GPU
#define _BALL_QUERY_GPU
#ifdef __cplusplus
extern "C" {
#endif
void group_points_kernel_wrapper(int b, int n, int c, int npoints, int nsample,
const float *points, const int *idx,
float *out, cudaStream_t stream);
void group_points_grad_kernel_wrapper(int b, int n, int c, int npoints,
int nsample, const float *grad_out,
const int *idx, float *grad_points,
cudaStream_t stream);
#ifdef __cplusplus
}
#endif
#endif
+8
View File
@@ -0,0 +1,8 @@
int group_points_wrapper(int b, int n, int c, int npoints, int nsample,
THCudaTensor *points_tensor,
THCudaIntTensor *idx_tensor, THCudaTensor *out);
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);
+27
View File
@@ -0,0 +1,27 @@
#ifndef _INTERPOLATE_GPU_H
#define _INTERPOLATE_GPU_H
#ifdef __cplusplus
extern "C" {
#endif
void three_nn_kernel_wrapper(int b, int n, int m, const float *unknown,
const float *known, float *dist2, int *idx,
cudaStream_t stream);
void three_interpolate_kernel_wrapper(int b, int m, int c, int n,
const float *points, const int *idx,
const float *weight, float *out,
cudaStream_t stream);
void three_interpolate_grad_kernel_wrapper(int b, int n, int c, int m,
const float *grad_out,
const int *idx, const float *weight,
float *grad_points,
cudaStream_t stream);
#ifdef __cplusplus
}
#endif
#endif
+16
View File
@@ -0,0 +1,16 @@
void three_nn_wrapper(int b, int n, int m, THCudaTensor *unknown_tensor,
THCudaTensor *known_tensor, THCudaTensor *dist2_tensor,
THCudaIntTensor *idx_tensor);
void three_interpolate_wrapper(int b, int m, int c, int n,
THCudaTensor *points_tensor,
THCudaIntTensor *idx_tensor,
THCudaTensor *weight_tensor,
THCudaTensor *out_tensor);
void three_interpolate_grad_wrapper(int b, int n, int c, int m,
THCudaTensor *grad_out_tensor,
THCudaIntTensor *idx_tensor,
THCudaTensor *weight_tensor,
THCudaTensor *grad_points_tensor);
+29
View File
@@ -0,0 +1,29 @@
#ifndef _ROI_MASK_POINTS_GPU_H
#define _ROI_MASK_POINTS_GPU_H
#ifdef __cplusplus
extern "C" {
#endif
void roi_mask_kernel_wrapper(int n_roi, int b, int n, const float *rois,
const long *batch_indices, const float *data_xyz,
unsigned char *mask, cudaStream_t stream);
void roi_avg_pool_kernel_forward_wrapper(int n_roi, int b, int n, int d,
const unsigned char *mask,
const long *batch_indices,
const float *points,
float *descriptors,
cudaStream_t stream);
void roi_avg_pool_kernel_backward_wrapper(int n_roi, int b, int n, int d,
const unsigned char *mask,
const long *batch_indices,
const float *grad_descriptors,
float *grad_points,
cudaStream_t stream);
#ifdef __cplusplus
}
#endif
#endif
+15
View File
@@ -0,0 +1,15 @@
int roi_mask_wrapper(int n_roi, int b, int n, THCudaTensor *rois_tensor,
THCudaLongTensor *batch_indices_tensor,
THCudaTensor *data_xyz_tensor,
THCudaByteTensor *mask_tensor);
int roi_avg_pool_forward_wrapper(int n_roi, int b, int n, int d,
THCudaByteTensor *mask_tensor,
THCudaLongTensor *batch_indices_tensor,
THCudaTensor *points_tensor,
THCudaTensor *descriptors_tensor);
int roi_avg_pool_backward_wrapper(int n_roi, int b, int n, int d,
THCudaByteTensor *mask_tensor,
THCudaLongTensor *batch_indices_tensor,
THCudaTensor *grad_descriptors_tensor,
THCudaTensor *grad_points_tensor);
+19
View File
@@ -0,0 +1,19 @@
#ifndef _SAMPLING_GPU_H
#define _SAMPLING_GPU_H
#ifdef __cplusplus
extern "C" {
#endif
void gather_points_kernel_wrapper(int b, int n, int c, int npoints,
const float *points, const int *idx,
float *out, cudaStream_t stream);
void furthest_point_sampling_kernel_wrapper(int b, int n, int m,
const float *dataset, float *temp,
int *idxs, cudaStream_t stream);
#ifdef __cplusplus
}
#endif
#endif
+10
View File
@@ -0,0 +1,10 @@
int gather_points_wrapper(int b, int n, int c, int npoints,
THCudaTensor *points_tensor,
THCudaIntTensor *idx_tensor,
THCudaTensor *out_tensor);
int furthest_point_sampling_wrapper(int b, int n, int m,
THCudaTensor *points_tensor,
THCudaTensor *temp_tensor,
THCudaIntTensor *idx_tensor);