-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy patheigen_half.patch
More file actions
22 lines (21 loc) · 806 Bytes
/
Copy patheigen_half.patch
File metadata and controls
22 lines (21 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- Eigen/src/Core/arch/CUDA/Half.h 2018-06-22 18:09:44.000000000 -0400
+++ ./Eigen/src/Core/arch/CUDA/Half.h 2018-07-25 01:19:55.462313100 -0400
@@ -209,7 +209,7 @@
// conversion steps back and forth.
EIGEN_STRONG_INLINE __device__ half operator + (const half& a, const half& b) {
- return __hadd(a, b);
+ return __hadd(::__half(a), ::__half(b));
}
EIGEN_STRONG_INLINE __device__ half operator * (const half& a, const half& b) {
return __hmul(a, b);
@@ -218,9 +218,7 @@
return __hsub(a, b);
}
EIGEN_STRONG_INLINE __device__ half operator / (const half& a, const half& b) {
- float num = __half2float(a);
- float denom = __half2float(b);
- return __float2half(num / denom);
+ return __hdiv(a, b);
}
EIGEN_STRONG_INLINE __device__ half operator - (const half& a) {
return __hneg(a);