Skip to content

Commit

Permalink
deleted zero check
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-miotk committed Jan 15, 2025
1 parent d87b7ee commit 0f32fa0
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,7 @@ inline void FUNC(quickSelectIterative)(__global Box* arr, int l, int h) {
// Pop h and l
h = stack[top--];
l = stack[top--];
bool all_zeroes = true; //when all zeroes algorithm stuck
for(int i=l;i<h;i++) {
if(arr[i].score != 0.0f) {
all_zeroes = false;
break;
}
}
if(all_zeroes) {
continue;
}

// Set pivot element at its correct position
// in sorted array
int p = FUNC_CALL(partition)(arr, l, h);
Expand Down Expand Up @@ -197,6 +188,7 @@ inline void FUNC(quickSelectIterative)(__global Box* arr, int l, int h) {
// 1. Sort boxes by scores
KERNEL(edgpsi_ref_stage_1)(__global OUTPUT_TYPE* proposals) {
__global Box* boxes = (__global Box*)proposals;

FUNC_CALL(quickSelectIterative)(boxes, 0, NUM_PROPOSALS-1);
}
#undef Box
Expand Down

0 comments on commit 0f32fa0

Please sign in to comment.