mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-13 18:37:27 +08:00
Added constructors to convert unsigned integers into fp16
This commit is contained in:
parent
42a3352a3b
commit
473c8380ea
@ -70,12 +70,18 @@ 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))) {}
|
||||
explicit EIGEN_DEVICE_FUNC half(float f)
|
||||
: __half(internal::float_to_half_rtne(f)) {}
|
||||
explicit EIGEN_DEVICE_FUNC half(double d)
|
||||
|
Loading…
x
Reference in New Issue
Block a user