Merge pull request #1794 from tomoaki0705:fixFp16CudevFailure

pull/1802/head
Alexander Alekhin 7 years ago
commit e6f5a4787c
  1. 2
      modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp

@ -288,7 +288,7 @@ template <> __device__ __forceinline__ short cast_fp16<float, short>(float v)
{ {
#if __CUDACC_VER_MAJOR__ >= 9 #if __CUDACC_VER_MAJOR__ >= 9
__half h(v); __half h(v);
return *(short*)&v; return *(short*)&h;
#else #else
return (short)__float2half_rn(v); return (short)__float2half_rn(v);
#endif #endif

Loading…
Cancel
Save