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
8708851e
Unverified
Commit
8708851e
authored
May 14, 2022
by
q.yao
Committed by
GitHub
May 14, 2022
Browse files
[Fix] Fix bbox overlap fp16 (#1958)
* add CUDA_ARCH check * add check in cuh
parent
a3b4640b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
mmcv/ops/csrc/common/cuda/bbox_overlaps_cuda_kernel.cuh
mmcv/ops/csrc/common/cuda/bbox_overlaps_cuda_kernel.cuh
+2
-0
mmcv/ops/csrc/pytorch/cuda/bbox_overlaps_cuda.cu
mmcv/ops/csrc/pytorch/cuda/bbox_overlaps_cuda.cu
+2
-0
No files found.
mmcv/ops/csrc/common/cuda/bbox_overlaps_cuda_kernel.cuh
View file @
8708851e
...
@@ -88,6 +88,7 @@ __global__ void bbox_overlaps_cuda_kernel(const T* bbox1, const T* bbox2,
...
@@ -88,6 +88,7 @@ __global__ void bbox_overlaps_cuda_kernel(const T* bbox1, const T* bbox2,
}
}
}
}
#if __CUDA_ARCH__ >= 530
__device__
__forceinline__
__half
__half_area
(
const
__half
x1
,
const
__half
y1
,
__device__
__forceinline__
__half
__half_area
(
const
__half
x1
,
const
__half
y1
,
const
__half
x2
,
const
__half
y2
,
const
__half
x2
,
const
__half
y2
,
const
__half
offset
)
{
const
__half
offset
)
{
...
@@ -141,5 +142,6 @@ __device__ void bbox_overlaps_cuda_kernel_half(
...
@@ -141,5 +142,6 @@ __device__ void bbox_overlaps_cuda_kernel_half(
ious
[
index
]
=
__hdiv
(
interS
,
baseS
);
ious
[
index
]
=
__hdiv
(
interS
,
baseS
);
}
}
}
}
#endif // __CUDA_ARCH__ >= 530
#endif // BBOX_OVERLAPS_CUDA_KERNEL_CUH
#endif // BBOX_OVERLAPS_CUDA_KERNEL_CUH
mmcv/ops/csrc/pytorch/cuda/bbox_overlaps_cuda.cu
View file @
8708851e
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
// Disable fp16 on ROCm device
// Disable fp16 on ROCm device
#ifndef HIP_DIFF
#ifndef HIP_DIFF
#if __CUDA_ARCH__ >= 530
template
<
>
template
<
>
__global__
void
bbox_overlaps_cuda_kernel
<
at
::
Half
>
(
__global__
void
bbox_overlaps_cuda_kernel
<
at
::
Half
>
(
const
at
::
Half
*
bbox1
,
const
at
::
Half
*
bbox2
,
at
::
Half
*
ious
,
const
at
::
Half
*
bbox1
,
const
at
::
Half
*
bbox2
,
at
::
Half
*
ious
,
...
@@ -14,6 +15,7 @@ __global__ void bbox_overlaps_cuda_kernel<at::Half>(
...
@@ -14,6 +15,7 @@ __global__ void bbox_overlaps_cuda_kernel<at::Half>(
reinterpret_cast
<
__half
*>
(
ious
),
num_bbox1
,
reinterpret_cast
<
__half
*>
(
ious
),
num_bbox1
,
num_bbox2
,
mode
,
aligned
,
offset
);
num_bbox2
,
mode
,
aligned
,
offset
);
}
}
#endif // __CUDA_ARCH__ >= 530
#endif // HIP_DIFF
#endif // HIP_DIFF
void
BBoxOverlapsCUDAKernelLauncher
(
const
Tensor
bboxes1
,
const
Tensor
bboxes2
,
void
BBoxOverlapsCUDAKernelLauncher
(
const
Tensor
bboxes1
,
const
Tensor
bboxes2
,
...
...
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