diff options
author | 2016-02-19 15:57:26 +0000 | |
---|---|---|
committer | 2016-02-19 15:57:26 +0000 | |
commit | f7cb755299b8cdee3b8eaffd2941af9ee6d08b04 (patch) | |
tree | 14777e9d406a0074db8b4262d91ba5eb9471f104 /Eigen/src | |
parent | dc26459b9910d8c1fda964917635ee8277dd2614 (diff) |
Added support for operators +=, -=, *= and /= on CUDA half floats
Diffstat (limited to 'Eigen/src')
-rw-r--r-- | Eigen/src/Core/arch/CUDA/PacketMathHalf.h | 16 |
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 }; }; |