-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the implementation of the Gridding layer (arXiv 2006.03761).
- Loading branch information
Showing
6 changed files
with
390 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <vector> | ||
|
||
#include <ATen/cuda/CUDAContext.h> | ||
#include <torch/extension.h> | ||
|
||
std::vector<torch::Tensor> gridding_kernel_warpper(float min_x, float max_x, float min_y, | ||
float max_y, float min_z, float max_z, | ||
torch::Tensor ptcloud, cudaStream_t stream); | ||
|
||
torch::Tensor gridding_grad_kernel_warpper(torch::Tensor grid_pt_weights, | ||
torch::Tensor grid_pt_indexes, torch::Tensor grad_grid, | ||
cudaStream_t stream); | ||
|
||
std::vector<torch::Tensor> gridding(float min_x, float max_x, float min_y, float max_y, float min_z, | ||
float max_z, torch::Tensor ptcloud); | ||
|
||
torch::Tensor gridding_grad(torch::Tensor grid_pt_weights, torch::Tensor grid_pt_indexes, | ||
torch::Tensor grad_grid); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "gridding.h" | ||
#include "utils.h" | ||
|
||
std::vector<torch::Tensor> gridding(float min_x, float max_x, float min_y, float max_y, float min_z, | ||
float max_z, torch::Tensor ptcloud) | ||
{ | ||
CHECK_CUDA(ptcloud); | ||
CHECK_CONTIGUOUS(ptcloud); | ||
|
||
cudaStream_t stream = at::cuda::getCurrentCUDAStream(); | ||
return gridding_kernel_warpper(min_x, max_x, min_y, max_y, min_z, max_z, ptcloud, stream); | ||
} | ||
|
||
torch::Tensor gridding_grad(torch::Tensor grid_pt_weights, torch::Tensor grid_pt_indexes, | ||
torch::Tensor grad_grid) | ||
{ | ||
CHECK_CUDA(grid_pt_weights); | ||
CHECK_CONTIGUOUS(grid_pt_weights); | ||
CHECK_CUDA(grid_pt_indexes); | ||
CHECK_CONTIGUOUS(grid_pt_indexes); | ||
CHECK_CUDA(grad_grid); | ||
CHECK_CONTIGUOUS(grad_grid); | ||
|
||
cudaStream_t stream = at::cuda::getCurrentCUDAStream(); | ||
return gridding_grad_kernel_warpper(grid_pt_weights, grid_pt_indexes, grad_grid, stream); | ||
} |
Oops, something went wrong.