Skip to content

Commit bc7f649

Browse files
committed
Merge pull request opencv#9769 from pstieber:FixPrivateIncludeInSaturateCast
2 parents 2a25377 + 5669ee8 commit bc7f649

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
#define OPENCV_CUDEV_UTIL_SATURATE_CAST_HPP
4848

4949
#include "../common.hpp"
50-
#include "opencv2/core/private.cuda.hpp"
50+
#if __CUDACC_VER_MAJOR__ >= 9
51+
#include <cuda_fp16.h>
52+
#endif
5153

5254
namespace cv { namespace cudev {
5355

@@ -275,7 +277,7 @@ template <typename T, typename D> __device__ __forceinline__ D cast_fp16(T v);
275277

276278
template <> __device__ __forceinline__ float cast_fp16<short, float>(short v)
277279
{
278-
#if __CUDACC_VER_MAJOR__ >= 9
280+
#if __CUDACC_VER_MAJOR__ >= 9
279281
return float(*(__half*)&v);
280282
#else
281283
return __half2float(v);
@@ -284,7 +286,7 @@ template <> __device__ __forceinline__ float cast_fp16<short, float>(short v)
284286

285287
template <> __device__ __forceinline__ short cast_fp16<float, short>(float v)
286288
{
287-
#if __CUDACC_VER_MAJOR__ >= 9
289+
#if __CUDACC_VER_MAJOR__ >= 9
288290
__half h(v);
289291
return *(short*)&v;
290292
#else

0 commit comments

Comments
 (0)