From 5669ee815bf724a1f3bf12429a07e6199154e230 Mon Sep 17 00:00:00 2001 From: "Peter J. Stieber" Date: Tue, 3 Oct 2017 17:47:52 -0700 Subject: [PATCH] Replace private.cuda.hpp with conditional include of cuda_fp16.h. --- modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp b/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp index 68a07a5..64a4574 100644 --- a/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp +++ b/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp @@ -47,7 +47,9 @@ #define OPENCV_CUDEV_UTIL_SATURATE_CAST_HPP #include "../common.hpp" -#include "opencv2/core/private.cuda.hpp" +#if __CUDACC_VER_MAJOR__ >= 9 +#include +#endif namespace cv { namespace cudev { @@ -275,7 +277,7 @@ template __device__ __forceinline__ D cast_fp16(T v); template <> __device__ __forceinline__ float cast_fp16(short v) { -#if __CUDACC_VER_MAJOR__ >= 9 +#if __CUDACC_VER_MAJOR__ >= 9 return float(*(__half*)&v); #else return __half2float(v); @@ -284,7 +286,7 @@ template <> __device__ __forceinline__ float cast_fp16(short v) template <> __device__ __forceinline__ short cast_fp16(float v) { -#if __CUDACC_VER_MAJOR__ >= 9 +#if __CUDACC_VER_MAJOR__ >= 9 __half h(v); return *(short*)&v; #else -- 2.7.4