Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
347e79c1
Commit
347e79c1
authored
Mar 28, 2023
by
Ted Themistokleous
Browse files
Pass by value to suppress_by_iou()
Make copies here since we're doing this calc in parallel
parent
8cced061
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
src/include/migraphx/op/nonmaxsuppression.hpp
src/include/migraphx/op/nonmaxsuppression.hpp
+10
-12
No files found.
src/include/migraphx/op/nonmaxsuppression.hpp
View file @
347e79c1
...
...
@@ -187,7 +187,7 @@ struct nonmaxsuppression
return
result
;
}
inline
bool
suppress_by_iou
(
box
&
b1
,
box
&
b2
,
double
iou_threshold
)
const
inline
bool
suppress_by_iou
(
box
b1
,
box
b2
,
double
iou_threshold
)
const
{
b1
.
sort
();
b2
.
sort
();
...
...
@@ -302,16 +302,14 @@ struct nonmaxsuppression
std
::
vector
<
std
::
pair
<
double
,
int64_t
>>
remainder_boxes
(
boxes_heap
.
size
());
auto
it
=
std
::
copy_if
(
std
::
execution
::
par
,
auto
it
=
std
::
copy_if
(
std
::
execution
::
par
,
boxes_heap
.
begin
(),
boxes_heap
.
end
(),
remainder_boxes
.
begin
(),
[
&
](
auto
iou_candidate_box
)
{
auto
iou_box
=
batch_box
(
batch_boxes_start
,
iou_candidate_box
.
second
);
return
not
this
->
suppress_by_iou
(
std
::
ref
(
iou_box
),
std
::
ref
(
next_box
),
iou_threshold
);
auto
iou_box
=
batch_box
(
batch_boxes_start
,
iou_candidate_box
.
second
);
return
not
this
->
suppress_by_iou
(
iou_box
,
next_box
,
iou_threshold
);
});
remainder_boxes
.
resize
(
it
-
remainder_boxes
.
begin
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment