14 #ifdef EIGEN_HAS_CUDA_FP16 15 #error "EIGEN_HAS_CUDA_FP16 should not be defined in this CPU unit test" 44 float val1 =
float(
half(__half_raw(0x3c00)));
45 float val2 =
float(
half(__half_raw(0x3c01)));
46 float val3 =
float(
half(__half_raw(0x3c02)));
104 std::cout <<
"highest = " <<
NumTraits<half>::highest() <<
" (0x" << std::hex << NumTraits<half>::highest().
x <<
")" << std::endl;
105 std::cout <<
"lowest = " <<
NumTraits<half>::lowest() <<
" (0x" << std::hex << NumTraits<half>::lowest().
x <<
")" << std::endl;
107 std::cout <<
"denorm min = " << (std::numeric_limits<half>::denorm_min)() <<
" (0x" << std::hex << half((std::numeric_limits<half>::denorm_min)()).
x <<
")" << std::endl;
108 std::cout <<
"infinity = " <<
NumTraits<half>::infinity() <<
" (0x" << std::hex << NumTraits<half>::infinity().
x <<
")" << std::endl;
109 std::cout <<
"quiet nan = " <<
NumTraits<half>::quiet_NaN() <<
" (0x" << std::hex << NumTraits<half>::quiet_NaN().
x <<
")" << std::endl;
110 std::cout <<
"signaling nan = " << std::numeric_limits<half>::signaling_NaN() <<
" (0x" << std::hex << std::numeric_limits<half>::signaling_NaN().
x <<
")" << std::endl;
114 VERIFY_IS_EQUAL( std::numeric_limits<half>::infinity().
x,
half(std::numeric_limits<float>::infinity()).
x );
115 VERIFY_IS_EQUAL( std::numeric_limits<half>::quiet_NaN().
x,
half(std::numeric_limits<float>::quiet_NaN()).
x );
116 VERIFY_IS_EQUAL( std::numeric_limits<half>::signaling_NaN().
x,
half(std::numeric_limits<float>::signaling_NaN()).
x );
118 VERIFY( (std::numeric_limits<half>::denorm_min)() >
half(0.
f) );
242 Index size = internal::random<Index>(1,10);
243 Index i = internal::random<Index>(0,size-1);
244 ArrayXh a1 = ArrayXh::Random(size), a2 = ArrayXh::Random(size);
249 VERIFY( ((a1.min)(a2) <= (a1.max)(a2)).all() );
255 std::stringstream
ss;
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T exp(const T &x)
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
EIGEN_DEVICE_FUNC const LogReturnType log() const
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Namespace containing all symbols from the Eigen library.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
void test_basic_functions()
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T cos(const T &x)
EIGEN_DEVICE_FUNC T() ceil(const T &x)
EIGEN_DEVICE_FUNC const CosReturnType cos() const
EIGEN_DEVICE_FUNC const CeilReturnType ceil() const
#define VERIFY_IS_APPROX(a, b)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE internal::enable_if< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typename NumTraits< T >::Real >::type abs(const T &x)
#define VERIFY_IS_EQUAL(a, b)
EIGEN_DEVICE_FUNC const Log1pReturnType log1p() const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T tan(const T &x)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC T() floor(const T &x)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
EIGEN_DEVICE_FUNC bool() isnan(const T &x)
EIGEN_DEVICE_FUNC const TanReturnType tan() const
void test_trigonometric_functions()
EIGEN_DEVICE_FUNC bool() isinf(const T &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T sin(const T &x)
static std::stringstream ss
EIGEN_DEVICE_FUNC internal::pow_impl< ScalarX, ScalarY >::result_type pow(const ScalarX &x, const ScalarY &y)
#define CALL_SUBTEST(FUNC)
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
General-purpose arrays with easy API for coefficient-wise operations.
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Jet< T, N > pow(const Jet< T, N > &f, double g)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T log(const T &x)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float sqrt(const float &x)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x