Skip to content

Commit

Permalink
points_in_boxes_all的mmcv适配 (#3186)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZrBac authored Oct 24, 2024
1 parent c39e9eb commit c46684c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions mmcv/ops/csrc/pytorch/npu/points_in_box_npu_all.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 points_in_boxes_all_forward_impl_npu(int batch_size, int boxes_num,
int pts_num, const Tensor boxes,
const Tensor pts,
Tensor box_idx_of_points) {
c10::SmallVector<int64_t, 8> output_size = {pts.size(0), pts.size(1), boxes.size(1)};
auto boxes_trans = boxes.transpose(1, 2).contiguous();
EXEC_NPU_CMD(aclnnPointsInBoxAll, boxes_trans, pts, box_idx_of_points);
}
void points_in_boxes_all_forward_impl(int batch_size, int boxes_num,
int pts_num, const Tensor boxes,
const Tensor pts,
Tensor box_idx_of_points);
REGISTER_NPU_IMPL(points_in_boxes_all_forward_impl,
points_in_boxes_all_forward_impl_npu);

0 comments on commit c46684c

Please sign in to comment.