aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-02-19 10:03:19 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-02-19 10:03:19 -0800
commit5c4901b83a3ec15988521e195abc05e804c541dc (patch)
tree1add3525cca03f35b8159bbbf041da165b2fe3e8 /Eigen/src
parentf268db1c4bd0510f13f0218205c2e135f2790175 (diff)
Implemented the scalar division of 2 half floats
Diffstat (limited to 'Eigen/src')
-rw-r--r--Eigen/src/Core/arch/CUDA/PacketMathHalf.h7
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;
}