Implemented the scalar division of 2 half floats

This commit is contained in:
Benoit Steiner 2016-02-19 10:03:19 -08:00
parent f268db1c4b
commit 5c4901b83a

View File

@ -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;
} }