Skip to content

Commit

Permalink
[Fix](bangc-ops):voxelization zero tensor bug fix. (Cambricon#755)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahxn0 authored Jun 25, 2023
1 parent 2fb1c29 commit 9a83e11
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bangc-ops/kernels/voxelization/voxelization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ mluOpStatus_t voxelizationParamCheck(
const mluOpTensorDescriptor_t voxels_desc,
const mluOpTensorDescriptor_t coors_desc,
const mluOpTensorDescriptor_t num_points_per_voxel_desc,
const mluOpTensorDescriptor_t voxel_num_desc, bool is_zero_element) {
const mluOpTensorDescriptor_t voxel_num_desc, bool *is_zero_element) {
// check arch
if (handle->arch < MLUOP_MLU370) {
LOG(ERROR) << "[mluOpVoxelization] The operator only support architecture "
Expand Down Expand Up @@ -134,7 +134,7 @@ mluOpStatus_t voxelizationParamCheck(
}

// check element num zero
is_zero_element = false;
*is_zero_element = false;
if (points_element_num == 0 || voxel_size_element_num == 0 ||
coors_range_element_num == 0) {
LOG(ERROR)
Expand All @@ -143,7 +143,7 @@ mluOpStatus_t voxelizationParamCheck(
}

if (max_points == 0 || max_voxels == 0) {
is_zero_element = true;
*is_zero_element = true;
}
} else {
VLOG(5) << "[mluOpVoxelization] Currently, Non-deterministic mode not "
Expand Down Expand Up @@ -180,7 +180,7 @@ mluOpStatus_t MLUOP_WIN_API mluOpGetVoxelizationWorkspaceSize(
mluOpStatus_t paramcheck_status = voxelizationParamCheck(
handle, points_desc, voxel_size_desc, coors_range_desc, max_points,
max_voxels, NDim, deterministic, voxels_desc, coors_desc,
num_points_per_voxel_desc, voxel_num_desc, is_zero_element);
num_points_per_voxel_desc, voxel_num_desc, &is_zero_element);
if (paramcheck_status != MLUOP_STATUS_SUCCESS) {
return paramcheck_status;
}
Expand Down Expand Up @@ -228,7 +228,7 @@ mluOpStatus_t MLUOP_WIN_API mluOpVoxelization(
mluOpStatus_t paramcheck_status = voxelizationParamCheck(
handle, points_desc, voxel_size_desc, coors_range_desc, max_points,
max_voxels, NDim, deterministic, voxels_desc, coors_desc,
num_points_per_voxel_desc, voxel_num_desc, is_zero_element);
num_points_per_voxel_desc, voxel_num_desc, &is_zero_element);
if (paramcheck_status != MLUOP_STATUS_SUCCESS) {
return paramcheck_status;
}
Expand Down

0 comments on commit 9a83e11

Please sign in to comment.