diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-02-19 10:03:19 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-02-19 10:03:19 -0800 |
commit | 5c4901b83a3ec15988521e195abc05e804c541dc (patch) | |
tree | 1add3525cca03f35b8159bbbf041da165b2fe3e8 /Eigen/src | |
parent | f268db1c4bd0510f13f0218205c2e135f2790175 (diff) |
Implemented the scalar division of 2 half floats
Diffstat (limited to 'Eigen/src')
-rw-r--r-- | Eigen/src/Core/arch/CUDA/PacketMathHalf.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Eigen/src/Core/arch/CUDA/PacketMathHalf.h b/Eigen/src/Core/arch/CUDA/PacketMathHalf.h index c99c1acf7..d0106f4f1 100644 --- a/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +++ b/Eigen/src/Core/arch/CUDA/PacketMathHalf.h @@ -33,8 +33,9 @@ __device__ half operator - (const half& a, const half& b) { return __hsub(a, b); } __device__ half operator / (const half& a, const half& b) { - assert(false && "tbd"); - return half(); + float num = __half2float(a); + float denom = __half2float(b); + return __float2half(num / denom); } __device__ half operator - (const half& a) { return __hneg(a); @@ -52,7 +53,7 @@ __device__ half operator -= (half& a, const half& b) { return a; } __device__ half operator /= (half& a, const half& b) { - assert(false && "tbd"); + a = a / b; return a; } |