Skip to content

Commit

Permalink
add points_in_box
Browse files Browse the repository at this point in the history
  • Loading branch information
momo609 committed Feb 5, 2024
1 parent 0dacfef commit 9e4876e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 42 deletions.
42 changes: 0 additions & 42 deletions mmcv/ops/csrc/pytorch/npu/ms_deform_attn.cpp

This file was deleted.

18 changes: 18 additions & 0 deletions mmcv/ops/csrc/pytorch/npu/points_in_box_npu.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "pytorch_npu_helper.hpp"

using namespace NPU_NAME_SPACE;
using namespace std;

void points_in_boxes_part_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)};
auto boxes_trans = boxes.transpose(1, 2).contiguous();
EXEC_NPU_CMD(aclnnPointsInBox, boxes_trans, pts, box_idx_of_points);
}
void points_in_boxes_part_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_part_forward_impl, points_in_boxes_part_forward_impl_npu);

0 comments on commit 9e4876e

Please sign in to comment.