30 #include "torch/script.h" 34 const torch::Tensor& voxel_size,
35 const torch::Tensor& points_range_min,
36 const torch::Tensor& points_range_max,
37 const int64_t max_points_per_voxel,
38 const int64_t max_voxels,
39 torch::Tensor& voxel_coords,
40 torch::Tensor& voxel_point_indices,
41 torch::Tensor& voxel_point_row_splits);
43 #ifdef BUILD_CUDA_MODULE 45 void VoxelizeCUDA(
const torch::Tensor&
points,
46 const torch::Tensor& voxel_size,
47 const torch::Tensor& points_range_min,
48 const torch::Tensor& points_range_max,
49 const int64_t max_points_per_voxel,
50 const int64_t max_voxels,
51 torch::Tensor& voxel_coords,
52 torch::Tensor& voxel_point_indices,
53 torch::Tensor& voxel_point_row_splits);
59 : device_type(device_type), device_idx(device_idx) {}
62 voxel_coords = torch::empty({rows, cols},
64 .device(device_type, device_idx));
65 *ptr = voxel_coords.data_ptr<
int32_t>();
71 .device(device_type, device_idx));
72 *ptr = voxel_point_indices.data_ptr<int64_t>();
76 voxel_point_row_splits =
78 .device(device_type, device_idx));
79 *ptr = voxel_point_row_splits.data_ptr<int64_t>();
82 const torch::Tensor&
VoxelCoords()
const {
return voxel_coords; }
84 return voxel_point_indices;
87 return voxel_point_row_splits;
91 torch::Tensor voxel_coords;
92 torch::Tensor voxel_point_indices;
93 torch::Tensor voxel_point_row_splits;
94 torch::DeviceType device_type;
Definition: VoxelizeOpKernel.h:56
VoxelizeOutputAllocator(torch::DeviceType device_type, int device_idx)
Definition: VoxelizeOpKernel.h:58
TorchDtype_t ToTorchDtype< int64_t >()
Definition: TorchHelper.h:94
const torch::Tensor & VoxelCoords() const
Definition: VoxelizeOpKernel.h:82
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t int32_t
Definition: K4aPlugin.cpp:398
void AllocVoxelPointRowSplits(int64_t **ptr, int64_t num)
Definition: VoxelizeOpKernel.h:75
void AllocVoxelPointIndices(int64_t **ptr, int64_t num)
Definition: VoxelizeOpKernel.h:68
const torch::Tensor & VoxelPointIndices() const
Definition: VoxelizeOpKernel.h:83
int points
Definition: FilePCD.cpp:73
void VoxelizeCPU(const torch::Tensor &points, const torch::Tensor &voxel_size, const torch::Tensor &points_range_min, const torch::Tensor &points_range_max, const int64_t max_points_per_voxel, const int64_t max_voxels, torch::Tensor &voxel_coords, torch::Tensor &voxel_point_indices, torch::Tensor &voxel_point_row_splits)
Definition: VoxelizeOpKernel.cpp:37
void AllocVoxelCoords(int32_t **ptr, int64_t rows, int64_t cols)
Definition: VoxelizeOpKernel.h:61
TorchDtype_t ToTorchDtype< int32_t >()
Definition: TorchHelper.h:90
const torch::Tensor & VoxelPointRowSplits() const
Definition: VoxelizeOpKernel.h:86