From a983d68fea6310f4cfa5b8e24010548414b53ece Mon Sep 17 00:00:00 2001 From: DanieeelLiu Date: Thu, 12 Oct 2023 20:07:41 +0800 Subject: [PATCH] [Fix](bangc-ops): revise docs according to review. --- .../box_iou_rotated/box_iou_rotated_utils.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bangc-ops/kernels/box_iou_rotated/box_iou_rotated_utils.h b/bangc-ops/kernels/box_iou_rotated/box_iou_rotated_utils.h index da412b32c9..a87cb0d4a2 100644 --- a/bangc-ops/kernels/box_iou_rotated/box_iou_rotated_utils.h +++ b/bangc-ops/kernels/box_iou_rotated/box_iou_rotated_utils.h @@ -449,11 +449,16 @@ __mlu_func__ void convexHullGraham( T *temp2_ram, T *temp3_ram, T *temp_long_1, T *temp_long_2, T *temp_long_3, const uint32_t &actual_box_num, const uint32_t &actual_compute_box_num) { int real_compute_box_num = actual_box_num < actual_compute_box_num? actual_box_num : actual_compute_box_num; - // int valid_box_count = __bang_count(valid_box, real_compute_box_num); - // if(!valid_box_count) - // { - // return; - // } + const int total_points = actual_compute_box_num * 24; + int valid_box_count = __bang_count(valid_box, real_compute_box_num); + if(!valid_box_count) + { + __bang_write_value(ordered_pts_x, total_points, 0); + __bang_write_value(ordered_pts_y, total_points, 0); + __bang_write_value(valid_pts, actual_compute_box_num, (T)1); + __bang_write_value(valid_pts + actual_compute_box_num, total_points - actual_compute_box_num, (T)0); + return; + } // __bang_printf("test\n"); // Step1. Find the point with minimum y, if more than 1 points have the // same minimum y, pick the one with the minimum x. set p[i].y to @@ -546,8 +551,6 @@ __mlu_func__ void convexHullGraham( dot2d((T *)dist_ram, (T *)intersect_pts_x, (T *)intersect_pts_y, (T *)intersect_pts_x, (T *)intersect_pts_y, 24 * actual_compute_box_num, (T *)temp_long_3); - - const int total_points = actual_compute_box_num * 24; // for (k = 1; k < num_in; k++) { // if (dist[k] > 1e-8) { // break;