Commit e6f5a478 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #1794 from tomoaki0705:fixFp16CudevFailure

parents 3054618f ff7dbee6
...@@ -288,7 +288,7 @@ template <> __device__ __forceinline__ short cast_fp16<float, short>(float v) ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment