mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-03 01:04:23 +08:00
Implemented the scalar division of 2 half floats
This commit is contained in:
parent
f268db1c4b
commit
5c4901b83a
@ -33,8 +33,9 @@ __device__ half operator - (const half& a, const half& b) {
|
|||||||
return __hsub(a, b);
|
return __hsub(a, b);
|
||||||
}
|
}
|
||||||
__device__ half operator / (const half& a, const half& b) {
|
__device__ half operator / (const half& a, const half& b) {
|
||||||
assert(false && "tbd");
|
float num = __half2float(a);
|
||||||
return half();
|
float denom = __half2float(b);
|
||||||
|
return __float2half(num / denom);
|
||||||
}
|
}
|
||||||
__device__ half operator - (const half& a) {
|
__device__ half operator - (const half& a) {
|
||||||
return __hneg(a);
|
return __hneg(a);
|
||||||
@ -52,7 +53,7 @@ __device__ half operator -= (half& a, const half& b) {
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
__device__ half operator /= (half& a, const half& b) {
|
__device__ half operator /= (half& a, const half& b) {
|
||||||
assert(false && "tbd");
|
a = a / b;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user