11 #ifndef EIGEN_GENERIC_TYPE_CASTING_H
12 #define EIGEN_GENERIC_TYPE_CASTING_H
23 #if (defined(EIGEN_HAS_CUDA_FP16) && defined(EIGEN_CUDA_ARCH) && EIGEN_CUDA_ARCH >= 300) || \
24 (defined(EIGEN_HAS_HIP_FP16) && defined(EIGEN_HIP_DEVICE_COMPILE))
25 return __float2half(
a);
42 #if (defined(EIGEN_HAS_CUDA_FP16) && defined(EIGEN_CUDA_ARCH) && EIGEN_CUDA_ARCH >= 300) || \
43 (defined(EIGEN_HAS_HIP_FP16) && defined(EIGEN_HIP_DEVICE_COMPILE))
44 return __float2half(
static_cast<float>(
a));
61 #if (defined(EIGEN_HAS_CUDA_FP16) && defined(EIGEN_CUDA_ARCH) && EIGEN_CUDA_ARCH >= 300) || \
62 (defined(EIGEN_HAS_HIP_FP16) && defined(EIGEN_HIP_DEVICE_COMPILE))
63 return __half2float(
a);
65 return static_cast<float>(
a);
108 return static_cast<float>(
a);
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
#define EIGEN_EMPTY_STRUCT_CTOR(X)
Definition: XprHelper.h:22
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
Definition: document.h:416
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1181
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:233
Definition: BFloat16.h:58
Definition: XprHelper.h:176
@ PacketAccess
Definition: XprHelper.h:180
@ Cost
Definition: XprHelper.h:179
float result_type
Definition: TypeCasting.h:106
float result_type
Definition: TypeCasting.h:59
Definition: UnaryFunctors.h:160
#define const
Definition: zconf.h:233