aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-02-19 15:57:26 +0000
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-02-19 15:57:26 +0000
commitf7cb755299b8cdee3b8eaffd2941af9ee6d08b04 (patch)
tree14777e9d406a0074db8b4262d91ba5eb9471f104 /Eigen/src
parentdc26459b9910d8c1fda964917635ee8277dd2614 (diff)
Added support for operators +=, -=, *= and /= on CUDA half floats
Diffstat (limited to 'Eigen/src')
-rw-r--r--Eigen/src/Core/arch/CUDA/PacketMathHalf.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/CUDA/PacketMathHalf.h b/Eigen/src/Core/arch/CUDA/PacketMathHalf.h
index 7f99376fb..c99c1acf7 100644
--- a/Eigen/src/Core/arch/CUDA/PacketMathHalf.h
+++ b/Eigen/src/Core/arch/CUDA/PacketMathHalf.h
@@ -39,6 +39,22 @@ __device__ half operator / (const half& a, const half& b) {
__device__ half operator - (const half& a) {
return __hneg(a);
}
+__device__ half operator += (half& a, const half& b) {
+ a = __hadd(a, b);
+ return a;
+}
+__device__ half operator *= (half& a, const half& b) {
+ a = __hmul(a, b);
+ return a;
+}
+__device__ half operator -= (half& a, const half& b) {
+ a = __hsub(a, b);
+ return a;
+}
+__device__ half operator /= (half& a, const half& b) {
+ assert(false && "tbd");
+ return a;
+}
template<> struct is_arithmetic<half2> { enum { value = true }; };