Skip to content

Commit

Permalink
[NPU] modify internal calls of npu boxes_overlap_bev & box_iou_rotated (
Browse files Browse the repository at this point in the history
  • Loading branch information
OlaWod authored Dec 23, 2024
1 parent 5de993a commit 761d780
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 1 addition & 4 deletions mmcv/ops/csrc/pytorch/npu/box_iou_rotated_npu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ void box_iou_rotated_npu(const Tensor boxes1, const Tensor boxes2, Tensor ious,
TORCH_CHECK(boxes1.size(1) == 5, "boxes1 must be 2D tensor (N, 5)");
TORCH_CHECK(boxes1.size(1) == 5, "boxes1 must be 2D tensor (N, 5)");

auto trans = false;
auto is_clockwise = false;
EXEC_NPU_CMD(aclnnBoxesOverlapBev, boxes1, boxes2, trans, is_clockwise,
aligned, mode_flag, ious);
EXEC_NPU_CMD(aclnnBoxIou, boxes1, boxes2, mode_flag, aligned, ious);
return;
}

Expand Down
12 changes: 7 additions & 5 deletions mmcv/ops/csrc/pytorch/npu/boxes_overlap_bev_npu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ void iou3d_boxes_overlap_bev_forward_npu(const int num_a, const Tensor boxes_a,
TORCH_CHECK(boxes_a.size(1) == 7, "boxes_a must be 2D tensor (N, 7)");
TORCH_CHECK(boxes_b.size(1) == 7, "boxes_b must be 2D tensor (N, 7)");

auto trans = false;
auto is_clockwise = false;
auto format_flag = 3;
auto clockwise = true;
auto mode_flag = 0;
auto aligned = false;
auto mode_flag = 2;
EXEC_NPU_CMD(aclnnBoxesOverlapBev, boxes_a, boxes_b, trans, is_clockwise,
aligned, mode_flag, ans_overlap);
auto margin = 1e-2;

EXEC_NPU_CMD(aclnnBoxesOverlapBev, boxes_a, boxes_b, format_flag, clockwise,
mode_flag, aligned, margin, ans_overlap);
return;
}

Expand Down

0 comments on commit 761d780

Please sign in to comment.