aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r--Eigen/src/Core/arch/CUDA/Half.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/Eigen/src/Core/arch/CUDA/Half.h b/Eigen/src/Core/arch/CUDA/Half.h
index d081c7392..5c44ee98f 100644
--- a/Eigen/src/Core/arch/CUDA/Half.h
+++ b/Eigen/src/Core/arch/CUDA/Half.h
@@ -72,22 +72,11 @@ struct half : public __half {
explicit EIGEN_DEVICE_FUNC half(bool b)
: __half(internal::raw_uint16_to_half(b ? 0x3c00 : 0)) {}
- explicit EIGEN_DEVICE_FUNC half(unsigned int ui)
- : __half(internal::float_to_half_rtne(static_cast<float>(ui))) {}
- explicit EIGEN_DEVICE_FUNC half(int i)
- : __half(internal::float_to_half_rtne(static_cast<float>(i))) {}
- explicit EIGEN_DEVICE_FUNC half(unsigned long ul)
- : __half(internal::float_to_half_rtne(static_cast<float>(ul))) {}
- explicit EIGEN_DEVICE_FUNC half(long l)
- : __half(internal::float_to_half_rtne(static_cast<float>(l))) {}
- explicit EIGEN_DEVICE_FUNC half(long long ll)
- : __half(internal::float_to_half_rtne(static_cast<float>(ll))) {}
- explicit EIGEN_DEVICE_FUNC half(unsigned long long ull)
- : __half(internal::float_to_half_rtne(static_cast<float>(ull))) {}
+ template<class T>
+ explicit EIGEN_DEVICE_FUNC half(const T& x)
+ : __half(internal::float_to_half_rtne(static_cast<float>(x))) {}
explicit EIGEN_DEVICE_FUNC half(float f)
: __half(internal::float_to_half_rtne(f)) {}
- explicit EIGEN_DEVICE_FUNC half(double d)
- : __half(internal::float_to_half_rtne(static_cast<float>(d))) {}
EIGEN_DEVICE_FUNC EIGEN_EXPLICIT_CAST(bool) const {
// +0.0 and -0.0 become false, everything else becomes true.