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
OpenDAS
MMCV
Commits
30057a61
Unverified
Commit
30057a61
authored
Apr 27, 2022
by
q.yao
Committed by
GitHub
Apr 27, 2022
Browse files
[Fix] Fix nms rotate illegal memory access (#1891)
parent
c324b1fc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
mmcv/ops/csrc/common/cuda/nms_rotated_cuda.cuh
mmcv/ops/csrc/common/cuda/nms_rotated_cuda.cuh
+6
-8
No files found.
mmcv/ops/csrc/common/cuda/nms_rotated_cuda.cuh
View file @
30057a61
...
@@ -43,18 +43,16 @@ __global__ void nms_rotated_cuda_kernel(const int n_boxes,
...
@@ -43,18 +43,16 @@ __global__ void nms_rotated_cuda_kernel(const int n_boxes,
// (x_center, y_center, width, height, angle_degrees) here.
// (x_center, y_center, width, height, angle_degrees) here.
__shared__
T
block_boxes
[
threadsPerBlock
*
5
];
__shared__
T
block_boxes
[
threadsPerBlock
*
5
];
if
(
threadIdx
.
x
<
col_size
)
{
if
(
threadIdx
.
x
<
col_size
)
{
block_boxes
[
threadIdx
.
x
*
6
+
0
]
=
block_boxes
[
threadIdx
.
x
*
5
+
0
]
=
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
0
];
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
0
];
block_boxes
[
threadIdx
.
x
*
6
+
1
]
=
block_boxes
[
threadIdx
.
x
*
5
+
1
]
=
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
1
];
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
1
];
block_boxes
[
threadIdx
.
x
*
6
+
2
]
=
block_boxes
[
threadIdx
.
x
*
5
+
2
]
=
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
2
];
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
2
];
block_boxes
[
threadIdx
.
x
*
6
+
3
]
=
block_boxes
[
threadIdx
.
x
*
5
+
3
]
=
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
3
];
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
3
];
block_boxes
[
threadIdx
.
x
*
6
+
4
]
=
block_boxes
[
threadIdx
.
x
*
5
+
4
]
=
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
4
];
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
4
];
block_boxes
[
threadIdx
.
x
*
6
+
5
]
=
dev_boxes
[(
threadsPerBlock
*
col_start
+
threadIdx
.
x
)
*
6
+
5
];
}
}
__syncthreads
();
__syncthreads
();
...
@@ -71,7 +69,7 @@ __global__ void nms_rotated_cuda_kernel(const int n_boxes,
...
@@ -71,7 +69,7 @@ __global__ void nms_rotated_cuda_kernel(const int n_boxes,
// Instead of devIoU used by original horizontal nms, here
// Instead of devIoU used by original horizontal nms, here
// we use the single_box_iou_rotated function from
// we use the single_box_iou_rotated function from
// box_iou_rotated_utils.h
// box_iou_rotated_utils.h
if
(
single_box_iou_rotated
<
T
>
(
cur_box
,
block_boxes
+
i
*
6
,
0
)
>
if
(
single_box_iou_rotated
<
T
>
(
cur_box
,
block_boxes
+
i
*
5
,
0
)
>
iou_threshold
)
{
iou_threshold
)
{
t
|=
1ULL
<<
i
;
t
|=
1ULL
<<
i
;
}
}
...
...
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