Skip to content

Commit

Permalink
adapt npu box_iou_quadri
Browse files Browse the repository at this point in the history
  • Loading branch information
OlaWod committed Sep 24, 2024
1 parent 3c9d327 commit ade50aa
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions mmcv/ops/csrc/pytorch/npu/box_iou_quadri_npu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "pytorch_npu_helper.hpp"

using namespace NPU_NAME_SPACE;
using namespace std;

void box_iou_quadri_impl(const Tensor boxes1, const Tensor boxes2, Tensor ious,
const int mode_flag, const bool aligned);

void box_iou_quadri_npu(const Tensor boxes1, const Tensor boxes2, Tensor ious,
const int mode_flag, const bool aligned) {

TORCH_CHECK(boxes1.size(1) == 8, "boxes1 must be 2D tensor (N, 8)");
TORCH_CHECK(boxes1.size(1) == 8, "boxes1 must be 2D tensor (N, 8)");

EXEC_NPU_CMD(aclnnBoxIou, boxes1, boxes2, mode_flag, aligned, ious);
return;
}

REGISTER_NPU_IMPL(box_iou_quadri_impl, box_iou_quadri_npu);

0 comments on commit ade50aa

Please sign in to comment.