From 5c4901b83a3ec15988521e195abc05e804c541dc Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 19 Feb 2016 10:03:19 -0800 Subject: [PATCH] Implemented the scalar division of 2 half floats --- Eigen/src/Core/arch/CUDA/PacketMathHalf.h | 7 ++++--- 1 file 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; }