mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 12:46:00 +08:00
Added support for operators +=, -=, *= and /= on CUDA half floats
This commit is contained in:
parent
dc26459b99
commit
f7cb755299
@ -39,6 +39,22 @@ __device__ half operator / (const half& a, const half& b) {
|
|||||||
__device__ half operator - (const half& a) {
|
__device__ half operator - (const half& a) {
|
||||||
return __hneg(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 }; };
|
template<> struct is_arithmetic<half2> { enum { value = true }; };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user