aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-04-06 09:59:51 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-04-06 09:59:51 -0700
commitcf7e73addd6405a132f9848d1d2c7bf93d8afdc0 (patch)
tree0556984420dd09cd76395fbea87527c136cb3f04 /Eigen
parent10bdd8e378e5e5907ea5e223662f493b037c99f1 (diff)
Added some missing conversions to the Half class, and fixed the implementation of the < operator on cuda devices.
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/arch/CUDA/Half.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/CUDA/Half.h b/Eigen/src/Core/arch/CUDA/Half.h
index 7f484b636..927be0493 100644
--- a/Eigen/src/Core/arch/CUDA/Half.h
+++ b/Eigen/src/Core/arch/CUDA/Half.h
@@ -175,11 +175,17 @@ __device__ bool operator != (const half& a, const half& b) {
return __hne(a, b);
}
__device__ bool operator < (const half& a, const half& b) {
+ return __hlt(a, b);
+}
+__device__ bool operator <= (const half& a, const half& b) {
return __hle(a, b);
}
__device__ bool operator > (const half& a, const half& b) {
return __hgt(a, b);
}
+__device__ bool operator >= (const half& a, const half& b) {
+ return __hge(a, b);
+}
#else // Emulate support for half floats
@@ -228,9 +234,15 @@ static inline EIGEN_DEVICE_FUNC bool operator != (const half& a, const half& b)
static inline EIGEN_DEVICE_FUNC bool operator < (const half& a, const half& b) {
return float(a) < float(b);
}
+static inline EIGEN_DEVICE_FUNC bool operator <= (const half& a, const half& b) {
+ return float(a) <= float(b);
+}
static inline EIGEN_DEVICE_FUNC bool operator > (const half& a, const half& b) {
return float(a) > float(b);
}
+static inline EIGEN_DEVICE_FUNC bool operator >= (const half& a, const half& b) {
+ return float(a) >= float(b);
+}
#endif // Emulate support for half floats