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
c8a9ae75
Unverified
Commit
c8a9ae75
authored
Sep 03, 2023
by
Zachary Streeter
Committed by
GitHub
Sep 03, 2023
Browse files
[Fix] Using PyTorch WARP_SHFL_DOWN macro for half support (#2843)
parent
6e9ee267
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
mmcv/ops/csrc/common/cuda/carafe_cuda_kernel.cuh
mmcv/ops/csrc/common/cuda/carafe_cuda_kernel.cuh
+4
-1
No files found.
mmcv/ops/csrc/common/cuda/carafe_cuda_kernel.cuh
View file @
c8a9ae75
...
...
@@ -2,6 +2,8 @@
#ifndef CARAFE_CUDA_KERNEL_CUH
#define CARAFE_CUDA_KERNEL_CUH
#include <ATen/cuda/DeviceUtils.cuh>
#ifdef MMCV_USE_PARROTS
#include "parrots_cuda_helper.hpp"
#else
...
...
@@ -56,7 +58,8 @@ template <>
__device__
__forceinline__
phalf
warpReduceSum
(
phalf
val
)
{
for
(
int
offset
=
WARP_SIZE
/
2
;
offset
>
0
;
offset
/=
2
)
#ifdef MMCV_WITH_HIP
__PHALF
(
val
)
+=
__shfl_down
(
val
,
offset
);
// Using PyTorch's macro for half support
__PHALF
(
val
)
+=
WARP_SHFL_DOWN
(
val
,
offset
);
#else
__PHALF
(
val
)
+=
__shfl_down_sync
(
FULL_MASK
,
__PHALF
(
val
).
operator
__half
(),
offset
);
...
...
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