30 #include "torch/script.h" 34 const torch::Tensor& row_splits,
35 const torch::Tensor& voxel_size,
36 const torch::Tensor& points_range_min,
37 const torch::Tensor& points_range_max,
38 const int64_t max_points_per_voxel,
39 const int64_t max_voxels,
40 torch::Tensor& voxel_coords,
41 torch::Tensor& voxel_point_indices,
42 torch::Tensor& voxel_point_row_splits,
43 torch::Tensor& voxel_batch_splits);
45 #ifdef BUILD_CUDA_MODULE 47 void VoxelizeCUDA(
const torch::Tensor&
points,
48 const torch::Tensor& row_splits,
49 const torch::Tensor& voxel_size,
50 const torch::Tensor& points_range_min,
51 const torch::Tensor& points_range_max,
52 const int64_t max_points_per_voxel,
53 const int64_t max_voxels,
54 torch::Tensor& voxel_coords,
55 torch::Tensor& voxel_point_indices,
56 torch::Tensor& voxel_point_row_splits,
57 torch::Tensor& voxel_batch_splits);
63 : device_type(device_type), device_idx(device_idx) {}
66 voxel_coords = torch::empty({rows, cols},
68 .device(device_type, device_idx));
69 *ptr = voxel_coords.data_ptr<
int32_t>();
75 .device(device_type, device_idx));
76 *ptr = voxel_point_indices.data_ptr<int64_t>();
80 voxel_point_row_splits =
82 .device(device_type, device_idx));
83 *ptr = voxel_point_row_splits.data_ptr<int64_t>();
89 .device(device_type, device_idx));
90 *ptr = voxel_batch_splits.data_ptr<int64_t>();
93 const torch::Tensor&
VoxelCoords()
const {
return voxel_coords; }
95 return voxel_point_indices;
98 return voxel_point_row_splits;
103 torch::Tensor voxel_coords;
104 torch::Tensor voxel_point_indices;
105 torch::Tensor voxel_point_row_splits;
106 torch::Tensor voxel_batch_splits;
107 torch::DeviceType device_type;
void AllocVoxelBatchSplits(int64_t **ptr, int64_t num)
Definition: VoxelizeOpKernel.h:86
Definition: VoxelizeOpKernel.h:60
VoxelizeOutputAllocator(torch::DeviceType device_type, int device_idx)
Definition: VoxelizeOpKernel.h:62
TorchDtype_t ToTorchDtype< int64_t >()
Definition: TorchHelper.h:95
const torch::Tensor & VoxelCoords() const
Definition: VoxelizeOpKernel.h:93
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:408
void AllocVoxelPointRowSplits(int64_t **ptr, int64_t num)
Definition: VoxelizeOpKernel.h:79
void AllocVoxelPointIndices(int64_t **ptr, int64_t num)
Definition: VoxelizeOpKernel.h:72
void VoxelizeCPU(const torch::Tensor &points, const torch::Tensor &row_splits, 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, torch::Tensor &voxel_batch_splits)
Definition: VoxelizeOpKernel.cpp:37
const torch::Tensor & VoxelPointIndices() const
Definition: VoxelizeOpKernel.h:94
const torch::Tensor & VoxelBatchSplits() const
Definition: VoxelizeOpKernel.h:100
void AllocVoxelCoords(int32_t **ptr, int64_t rows, int64_t cols)
Definition: VoxelizeOpKernel.h:65
TorchDtype_t ToTorchDtype< int32_t >()
Definition: TorchHelper.h:91
const torch::Tensor & VoxelPointRowSplits() const
Definition: VoxelizeOpKernel.h:97