diff --git a/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp b/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp index 64a4574ffd..59fd8da45a 100644 --- a/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp +++ b/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp @@ -288,7 +288,7 @@ template <> __device__ __forceinline__ short cast_fp16(float v) { #if __CUDACC_VER_MAJOR__ >= 9 __half h(v); - return *(short*)&v; + return *(short*)&h; #else return (short)__float2half_rn(v); #endif