Skip to content

Commit dde04d5

Browse files
committed
Addressing CUDA9 shfl deprecation
1 parent 91ef0b9 commit dde04d5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/core/include/opencv2/core/cuda/warp_shuffle.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@
5151

5252
namespace cv { namespace cuda { namespace device
5353
{
54+
#if __CUDACC_VER_MAJOR__ >= 9
55+
# define __shfl(x, y, z) __shfl_sync(0xFFFFFFFFU, x, y, z)
56+
# define __shfl_up(x, y, z) __shfl_up_sync(0xFFFFFFFFU, x, y, z)
57+
# define __shfl_down(x, y, z) __shfl_down_sync(0xFFFFFFFFU, x, y, z)
58+
#endif
5459
template <typename T>
5560
__device__ __forceinline__ T shfl(T val, int srcLane, int width = warpSize)
5661
{
@@ -148,6 +153,10 @@ namespace cv { namespace cuda { namespace device
148153
}
149154
}}}
150155

156+
# undef __shfl
157+
# undef __shfl_up
158+
# undef __shfl_down
159+
151160
//! @endcond
152161

153162
#endif // OPENCV_CUDA_WARP_SHUFFLE_HPP

0 commit comments

Comments
 (0)