14#if defined(EIGEN_GPU_COMPILE_PHASE)
18 #if defined(EIGEN_CUDA_ARCH)
19 #include <math_constants.h>
22 #if defined(EIGEN_HIP_DEVICE_COMPILE)
23 #include "Eigen/src/Core/arch/HIP/hcc/math_constants.h"
29#define EIGEN_ICC_NEEDS_CSTDINT (EIGEN_COMP_ICC>=1600 && EIGEN_COMP_CXXVER >= 11)
32#if EIGEN_HAS_CXX11 || EIGEN_ICC_NEEDS_CSTDINT
36typedef std::uint8_t uint8_t;
37typedef std::int8_t int8_t;
38typedef std::uint16_t uint16_t;
39typedef std::int16_t int16_t;
40typedef std::uint32_t uint32_t;
41typedef std::int32_t int32_t;
42typedef std::uint64_t uint64_t;
43typedef std::int64_t int64_t;
52typedef ::uint8_t uint8_t;
53typedef ::int8_t int8_t;
54typedef ::uint16_t uint16_t;
55typedef ::int16_t int16_t;
56typedef ::uint32_t uint32_t;
57typedef ::int32_t int32_t;
58typedef ::uint64_t uint64_t;
59typedef ::int64_t int64_t;
66typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex;
74typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE
Index;
87#if EIGEN_ICC_NEEDS_CSTDINT
88typedef std::intptr_t IntPtr;
89typedef std::uintptr_t UIntPtr;
91typedef std::ptrdiff_t IntPtr;
92typedef std::size_t UIntPtr;
94#undef EIGEN_ICC_NEEDS_CSTDINT
96struct true_type {
enum { value = 1 }; };
97struct false_type {
enum { value = 0 }; };
99template<
bool Condition>
103struct bool_constant<true> : true_type {};
106struct bool_constant<false> : false_type {};
108template<
bool Condition,
typename Then,
typename Else>
109struct conditional {
typedef Then type; };
111template<
typename Then,
typename Else>
112struct conditional <false, Then, Else> {
typedef Else type; };
114template<
typename T>
struct remove_reference {
typedef T type; };
115template<
typename T>
struct remove_reference<T&> {
typedef T type; };
117template<
typename T>
struct remove_pointer {
typedef T type; };
118template<
typename T>
struct remove_pointer<T*> {
typedef T type; };
119template<
typename T>
struct remove_pointer<T*
const> {
typedef T type; };
121template <
class T>
struct remove_const {
typedef T type; };
122template <
class T>
struct remove_const<const T> {
typedef T type; };
123template <
class T>
struct remove_const<const T[]> {
typedef T type[]; };
124template <
class T,
unsigned int Size>
struct remove_const<const T[Size]> {
typedef T type[Size]; };
126template<
typename T>
struct remove_all {
typedef T type; };
127template<
typename T>
struct remove_all<const T> {
typedef typename remove_all<T>::type type; };
128template<
typename T>
struct remove_all<T const&> {
typedef typename remove_all<T>::type type; };
129template<
typename T>
struct remove_all<T&> {
typedef typename remove_all<T>::type type; };
130template<
typename T>
struct remove_all<T const*> {
typedef typename remove_all<T>::type type; };
131template<
typename T>
struct remove_all<T*> {
typedef typename remove_all<T>::type type; };
133template<
typename T>
struct is_arithmetic {
enum { value =
false }; };
134template<>
struct is_arithmetic<float> {
enum { value =
true }; };
135template<>
struct is_arithmetic<double> {
enum { value =
true }; };
136template<>
struct is_arithmetic<long double> {
enum { value =
true }; };
137template<>
struct is_arithmetic<bool> {
enum { value =
true }; };
138template<>
struct is_arithmetic<char> {
enum { value =
true }; };
139template<>
struct is_arithmetic<signed char> {
enum { value =
true }; };
140template<>
struct is_arithmetic<unsigned char> {
enum { value =
true }; };
141template<>
struct is_arithmetic<signed short> {
enum { value =
true }; };
142template<>
struct is_arithmetic<unsigned short>{
enum { value =
true }; };
143template<>
struct is_arithmetic<signed int> {
enum { value =
true }; };
144template<>
struct is_arithmetic<unsigned int> {
enum { value =
true }; };
145template<>
struct is_arithmetic<signed long> {
enum { value =
true }; };
146template<>
struct is_arithmetic<unsigned long> {
enum { value =
true }; };
148template<
typename T,
typename U>
struct is_same {
enum { value = 0 }; };
149template<
typename T>
struct is_same<T,T> {
enum { value = 1 }; };
152struct is_void : is_same<void, typename remove_const<T>::type> {};
155template<>
struct is_arithmetic<signed long long> {
enum { value =
true }; };
156template<>
struct is_arithmetic<unsigned long long> {
enum { value =
true }; };
157using std::is_integral;
159template<
typename T>
struct is_integral {
enum { value =
false }; };
160template<>
struct is_integral<bool> {
enum { value =
true }; };
161template<>
struct is_integral<char> {
enum { value =
true }; };
162template<>
struct is_integral<signed char> {
enum { value =
true }; };
163template<>
struct is_integral<unsigned char> {
enum { value =
true }; };
164template<>
struct is_integral<signed short> {
enum { value =
true }; };
165template<>
struct is_integral<unsigned short> {
enum { value =
true }; };
166template<>
struct is_integral<signed int> {
enum { value =
true }; };
167template<>
struct is_integral<unsigned int> {
enum { value =
true }; };
168template<>
struct is_integral<signed long> {
enum { value =
true }; };
169template<>
struct is_integral<unsigned long> {
enum { value =
true }; };
171template<>
struct is_integral<signed __int64> {
enum { value =
true }; };
172template<>
struct is_integral<unsigned __int64> {
enum { value =
true }; };
177using std::make_unsigned;
182template<
typename>
struct make_unsigned;
184template<>
struct make_unsigned<long long int> {
typedef unsigned long long int type; };
185template<>
struct make_unsigned<char> {
typedef unsigned char type; };
186template<>
struct make_unsigned<signed char> {
typedef unsigned char type; };
187template<>
struct make_unsigned<unsigned char> {
typedef unsigned char type; };
188template<>
struct make_unsigned<signed short> {
typedef unsigned short type; };
189template<>
struct make_unsigned<unsigned short> {
typedef unsigned short type; };
190template<>
struct make_unsigned<signed int> {
typedef unsigned int type; };
191template<>
struct make_unsigned<unsigned int> {
typedef unsigned int type; };
192template<>
struct make_unsigned<signed long> {
typedef unsigned long type; };
193template<>
struct make_unsigned<unsigned long> {
typedef unsigned long type; };
195template<>
struct make_unsigned<signed __int64> {
typedef unsigned __int64 type; };
196template<>
struct make_unsigned<unsigned __int64> {
typedef unsigned __int64 type; };
204#if EIGEN_OS_MAC || EIGEN_COMP_MINGW
205template<>
struct make_unsigned<unsigned long long> {
typedef unsigned long long type; };
206template<>
struct make_unsigned<long long> {
typedef unsigned long long type; };
210template <
typename T>
struct add_const {
typedef const T type; };
211template <
typename T>
struct add_const<T&> {
typedef T& type; };
213template <
typename T>
struct is_const {
enum { value = 0 }; };
214template <
typename T>
struct is_const<T const> {
enum { value = 1 }; };
216template<
typename T>
struct add_const_on_value_type {
typedef const T type; };
217template<
typename T>
struct add_const_on_value_type<T&> {
typedef T
const& type; };
218template<
typename T>
struct add_const_on_value_type<T*> {
typedef T
const* type; };
219template<
typename T>
struct add_const_on_value_type<T*
const> {
typedef T
const*
const type; };
220template<
typename T>
struct add_const_on_value_type<T const*
const> {
typedef T
const*
const type; };
224using std::is_convertible;
228template<
typename From,
typename To>
229struct is_convertible_impl
232 struct any_conversion
234 template <
typename T> any_conversion(
const volatile T&);
235 template <
typename T> any_conversion(T&);
237 struct yes {
int a[1];};
238 struct no {
int a[2];};
241 static yes test(T,
int);
244 static no test(any_conversion, ...);
247 static typename internal::remove_reference<From>::type* ms_from;
248#ifdef __INTEL_COMPILER
250 #pragma warning ( disable : 2259 )
252 enum { value =
sizeof(test<To>(*ms_from, 0))==
sizeof(yes) };
253#ifdef __INTEL_COMPILER
258template<
typename From,
typename To>
261 enum { value = is_convertible_impl<From,To>::value };
265struct is_convertible<T,T&> {
enum { value =
false }; };
268struct is_convertible<const T,const T&> {
enum { value =
true }; };
275template<
bool Condition,
typename T=
void>
struct enable_if;
277template<
typename T>
struct enable_if<true,T>
280#if defined(EIGEN_GPU_COMPILE_PHASE) && !EIGEN_HAS_CXX11
281#if !defined(__FLT_EPSILON__)
282#define __FLT_EPSILON__ FLT_EPSILON
283#define __DBL_EPSILON__ DBL_EPSILON
288template<
typename T>
struct numeric_limits
291 static EIGEN_CONSTEXPR T epsilon() {
return 0; }
292 static T (max)() { assert(
false &&
"Highest not supported for this type"); }
293 static T (min)() { assert(
false &&
"Lowest not supported for this type"); }
294 static T infinity() { assert(
false &&
"Infinity not supported for this type"); }
295 static T quiet_NaN() { assert(
false &&
"quiet_NaN not supported for this type"); }
297template<>
struct numeric_limits<float>
299 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
300 static float epsilon() {
return __FLT_EPSILON__; }
302 static float (max)() {
303 #if defined(EIGEN_CUDA_ARCH)
304 return CUDART_MAX_NORMAL_F;
306 return HIPRT_MAX_NORMAL_F;
309 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
310 static float (min)() {
return FLT_MIN; }
312 static float infinity() {
313 #if defined(EIGEN_CUDA_ARCH)
320 static float quiet_NaN() {
321 #if defined(EIGEN_CUDA_ARCH)
328template<>
struct numeric_limits<double>
330 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
331 static double epsilon() {
return __DBL_EPSILON__; }
332 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
333 static double (max)() {
return DBL_MAX; }
334 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
335 static double (min)() {
return DBL_MIN; }
337 static double infinity() {
338 #if defined(EIGEN_CUDA_ARCH)
345 static double quiet_NaN() {
346 #if defined(EIGEN_CUDA_ARCH)
353template<>
struct numeric_limits<int>
355 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
356 static int epsilon() {
return 0; }
357 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
358 static int (max)() {
return INT_MAX; }
359 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
360 static int (min)() {
return INT_MIN; }
362template<>
struct numeric_limits<unsigned int>
364 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
365 static unsigned int epsilon() {
return 0; }
366 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
367 static unsigned int (max)() {
return UINT_MAX; }
368 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
369 static unsigned int (min)() {
return 0; }
371template<>
struct numeric_limits<long>
373 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
374 static long epsilon() {
return 0; }
375 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
376 static long (max)() {
return LONG_MAX; }
377 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
378 static long (min)() {
return LONG_MIN; }
380template<>
struct numeric_limits<unsigned long>
382 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
383 static unsigned long epsilon() {
return 0; }
384 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
385 static unsigned long (max)() {
return ULONG_MAX; }
386 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
387 static unsigned long (min)() {
return 0; }
389template<>
struct numeric_limits<long long>
391 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
392 static long long epsilon() {
return 0; }
393 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
394 static long long (max)() {
return LLONG_MAX; }
395 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
396 static long long (min)() {
return LLONG_MIN; }
398template<>
struct numeric_limits<unsigned long long>
400 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
401 static unsigned long long epsilon() {
return 0; }
402 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
403 static unsigned long long (max)() {
return ULLONG_MAX; }
404 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
405 static unsigned long long (min)() {
return 0; }
407template<>
struct numeric_limits<bool>
409 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
410 static bool epsilon() {
return false; }
411 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
412 static bool (max)() {
return true; }
413 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
414 static bool (min)() {
return false; }
426 EIGEN_DEVICE_FUNC noncopyable(
const noncopyable&);
427 EIGEN_DEVICE_FUNC
const noncopyable& operator=(
const noncopyable&);
429 EIGEN_DEVICE_FUNC noncopyable() {}
430 EIGEN_DEVICE_FUNC ~noncopyable() {}
447template<
typename T,
typename EnableIf =
void>
struct array_size {
451template<
typename T>
struct array_size<T,typename internal::enable_if<((T::SizeAtCompileTime&0)==0)>::type> {
452 enum { value = T::SizeAtCompileTime };
455template<
typename T,
int N>
struct array_size<const T (&)[N]> {
458template<
typename T,
int N>
struct array_size<T (&)[N]> {
463template<
typename T, std::
size_t N>
struct array_size<const std::array<T,N> > {
466template<
typename T, std::
size_t N>
struct array_size<std::array<T,N> > {
481EIGEN_CONSTEXPR
Index size(
const T& x) {
return x.size(); }
483template<
typename T,std::
size_t N>
484EIGEN_CONSTEXPR
Index size(
const T (&) [N]) {
return N; }
501#if EIGEN_HAS_STD_INVOKE_RESULT
502template<
typename T>
struct result_of;
504template<
typename F,
typename... ArgTypes>
505struct result_of<F(ArgTypes...)> {
506 typedef typename std::invoke_result<F, ArgTypes...>::type type1;
507 typedef typename remove_all<type1>::type type;
509#elif EIGEN_HAS_STD_RESULT_OF
510template<
typename T>
struct result_of {
511 typedef typename std::result_of<T>::type type1;
512 typedef typename remove_all<type1>::type type;
515template<
typename T>
struct result_of { };
517struct has_none {
int a[1];};
518struct has_std_result_type {
int a[2];};
519struct has_tr1_result {
int a[3];};
521template<
typename Func,
int SizeOf>
522struct nullary_result_of_select {};
524template<
typename Func>
525struct nullary_result_of_select<Func, sizeof(has_std_result_type)> {
typedef typename Func::result_type type;};
527template<
typename Func>
528struct nullary_result_of_select<Func, sizeof(has_tr1_result)> {
typedef typename Func::template result<Func()>::type type;};
530template<
typename Func>
531struct result_of<Func()> {
533 static has_std_result_type testFunctor(T
const *,
typename T::result_type
const * = 0);
535 static has_tr1_result testFunctor(T
const *,
typename T::template result<T()>::type
const * = 0);
536 static has_none testFunctor(...);
539 enum {FunctorType =
sizeof(testFunctor(
static_cast<Func*
>(0)))};
540 typedef typename nullary_result_of_select<Func, FunctorType>::type type;
543template<
typename Func,
typename ArgType,
int SizeOf=sizeof(has_none)>
544struct unary_result_of_select {
typedef typename internal::remove_all<ArgType>::type type;};
546template<
typename Func,
typename ArgType>
547struct unary_result_of_select<Func, ArgType, sizeof(has_std_result_type)> {
typedef typename Func::result_type type;};
549template<
typename Func,
typename ArgType>
550struct unary_result_of_select<Func, ArgType, sizeof(has_tr1_result)> {
typedef typename Func::template result<Func(ArgType)>::type type;};
552template<
typename Func,
typename ArgType>
553struct result_of<Func(ArgType)> {
555 static has_std_result_type testFunctor(T
const *,
typename T::result_type
const * = 0);
557 static has_tr1_result testFunctor(T
const *,
typename T::template result<T(ArgType)>::type
const * = 0);
558 static has_none testFunctor(...);
561 enum {FunctorType =
sizeof(testFunctor(
static_cast<Func*
>(0)))};
562 typedef typename unary_result_of_select<Func, ArgType, FunctorType>::type type;
565template<
typename Func,
typename ArgType0,
typename ArgType1,
int SizeOf=sizeof(has_none)>
566struct binary_result_of_select {
typedef typename internal::remove_all<ArgType0>::type type;};
568template<
typename Func,
typename ArgType0,
typename ArgType1>
569struct binary_result_of_select<Func, ArgType0, ArgType1, sizeof(has_std_result_type)>
570{
typedef typename Func::result_type type;};
572template<
typename Func,
typename ArgType0,
typename ArgType1>
573struct binary_result_of_select<Func, ArgType0, ArgType1, sizeof(has_tr1_result)>
574{
typedef typename Func::template result<Func(ArgType0,ArgType1)>::type type;};
576template<
typename Func,
typename ArgType0,
typename ArgType1>
577struct result_of<Func(ArgType0,ArgType1)> {
579 static has_std_result_type testFunctor(T
const *,
typename T::result_type
const * = 0);
581 static has_tr1_result testFunctor(T
const *,
typename T::template result<T(ArgType0,ArgType1)>::type
const * = 0);
582 static has_none testFunctor(...);
585 enum {FunctorType =
sizeof(testFunctor(
static_cast<Func*
>(0)))};
586 typedef typename binary_result_of_select<Func, ArgType0, ArgType1, FunctorType>::type type;
589template<
typename Func,
typename ArgType0,
typename ArgType1,
typename ArgType2,
int SizeOf=sizeof(has_none)>
590struct ternary_result_of_select {
typedef typename internal::remove_all<ArgType0>::type type;};
592template<
typename Func,
typename ArgType0,
typename ArgType1,
typename ArgType2>
593struct ternary_result_of_select<Func, ArgType0, ArgType1, ArgType2, sizeof(has_std_result_type)>
594{
typedef typename Func::result_type type;};
596template<
typename Func,
typename ArgType0,
typename ArgType1,
typename ArgType2>
597struct ternary_result_of_select<Func, ArgType0, ArgType1, ArgType2, sizeof(has_tr1_result)>
598{
typedef typename Func::template result<Func(ArgType0,ArgType1,ArgType2)>::type type;};
600template<
typename Func,
typename ArgType0,
typename ArgType1,
typename ArgType2>
601struct result_of<Func(ArgType0,ArgType1,ArgType2)> {
603 static has_std_result_type testFunctor(T
const *,
typename T::result_type
const * = 0);
605 static has_tr1_result testFunctor(T
const *,
typename T::template result<T(ArgType0,ArgType1,ArgType2)>::type
const * = 0);
606 static has_none testFunctor(...);
609 enum {FunctorType =
sizeof(testFunctor(
static_cast<Func*
>(0)))};
610 typedef typename ternary_result_of_select<Func, ArgType0, ArgType1, ArgType2, FunctorType>::type type;
615#if EIGEN_HAS_STD_INVOKE_RESULT
616template<
typename F,
typename... ArgTypes>
617struct invoke_result {
618 typedef typename std::invoke_result<F, ArgTypes...>::type type1;
619 typedef typename remove_all<type1>::type type;
622template<
typename F,
typename... ArgTypes>
623struct invoke_result {
624 typedef typename result_of<F(ArgTypes...)>::type type1;
625 typedef typename remove_all<type1>::type type;
628template<
typename F,
typename ArgType0 =
void,
typename ArgType1 =
void,
typename ArgType2 =
void>
629struct invoke_result {
630 typedef typename result_of<F(ArgType0, ArgType1, ArgType2)>::type type1;
631 typedef typename remove_all<type1>::type type;
635struct invoke_result<F, void, void, void> {
636 typedef typename result_of<F()>::type type1;
637 typedef typename remove_all<type1>::type type;
640template<
typename F,
typename ArgType0>
641struct invoke_result<F, ArgType0, void, void> {
642 typedef typename result_of<F(ArgType0)>::type type1;
643 typedef typename remove_all<type1>::type type;
646template<
typename F,
typename ArgType0,
typename ArgType1>
647struct invoke_result<F, ArgType0, ArgType1, void> {
648 typedef typename result_of<F(ArgType0, ArgType1)>::type type1;
649 typedef typename remove_all<type1>::type type;
653struct meta_yes {
char a[1]; };
654struct meta_no {
char a[2]; };
660 template <
typename C>
static meta_yes testFunctor(C
const *,
typename C::ReturnType
const * = 0);
661 template <
typename C>
static meta_no testFunctor(...);
663 enum { value =
sizeof(testFunctor<T>(
static_cast<T*
>(0))) ==
sizeof(meta_yes) };
666template<
typename T>
const T* return_ptr();
668template <
typename T,
typename IndexType=Index>
669struct has_nullary_operator
671 template <
typename C>
static meta_yes testFunctor(C
const *,
typename enable_if<(
sizeof(return_ptr<C>()->
operator()())>0)>::type * = 0);
672 static meta_no testFunctor(...);
674 enum { value =
sizeof(testFunctor(
static_cast<T*
>(0))) ==
sizeof(meta_yes) };
677template <
typename T,
typename IndexType=Index>
678struct has_unary_operator
680 template <
typename C>
static meta_yes testFunctor(C
const *,
typename enable_if<(
sizeof(return_ptr<C>()->
operator()(IndexType(0)))>0)>::type * = 0);
681 static meta_no testFunctor(...);
683 enum { value =
sizeof(testFunctor(
static_cast<T*
>(0))) ==
sizeof(meta_yes) };
686template <
typename T,
typename IndexType=Index>
687struct has_binary_operator
689 template <
typename C>
static meta_yes testFunctor(C
const *,
typename enable_if<(
sizeof(return_ptr<C>()->
operator()(IndexType(0),IndexType(0)))>0)>::type * = 0);
690 static meta_no testFunctor(...);
692 enum { value =
sizeof(testFunctor(
static_cast<T*
>(0))) ==
sizeof(meta_yes) };
700 int SupX = ((Y==1) ? 1 : Y/2),
701 bool Done = ((SupX-InfX)<=1 ? true : ((SupX*SupX <= Y) && ((SupX+1)*(SupX+1) > Y))) >
706 MidX = (InfX+SupX)/2,
707 TakeInf = MidX*MidX > Y ? 1 : 0,
708 NewInf = int(TakeInf) ? InfX : int(MidX),
709 NewSup = int(TakeInf) ? int(MidX) : SupX
712 enum { ret = meta_sqrt<Y,NewInf,NewSup>::ret };
715template<
int Y,
int InfX,
int SupX>
716class meta_sqrt<Y, InfX, SupX, true> {
public:
enum { ret = (SupX*SupX <= Y) ? SupX : InfX }; };
722template<
int A,
int B,
int K=1,
bool Done = ((A*K)%B)==0,
bool Big=(A>=B)>
723struct meta_least_common_multiple
725 enum { ret = meta_least_common_multiple<A,B,K+1>::ret };
727template<
int A,
int B,
int K,
bool Done>
728struct meta_least_common_multiple<A,B,K,Done,false>
730 enum { ret = meta_least_common_multiple<B,A,K>::ret };
732template<
int A,
int B,
int K>
733struct meta_least_common_multiple<A,B,K,true,true>
740template<
typename T,
typename U>
struct scalar_product_traits
742 enum { Defined = 0 };
754template<
unsigned Len,
unsigned Align>
755struct aligned_storage {
757 EIGEN_ALIGN_TO_BOUNDARY(Align)
unsigned char data[Len];
765#if defined(EIGEN_GPU_COMPILE_PHASE)
766template<
typename T> EIGEN_DEVICE_FUNC
void swap(T &a, T &b) { T tmp = b; b = a; a = tmp; }
768template<
typename T> EIGEN_STRONG_INLINE
void swap(T &a, T &b) { std::swap(a,b); }
771#if defined(EIGEN_GPU_COMPILE_PHASE) && !EIGEN_HAS_CXX11
772using internal::device::numeric_limits;
774using std::numeric_limits;
781T div_ceil(
const T &a,
const T &b)
788template<
typename X,
typename Y> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
789bool equal_strict(
const X& x,
const Y& y) {
return x == y; }
791#if !defined(EIGEN_GPU_COMPILE_PHASE) || (!defined(EIGEN_CUDA_ARCH) && defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC))
792template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
793bool equal_strict(
const float& x,
const float& y) {
return std::equal_to<float>()(x,y); }
795template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
796bool equal_strict(
const double& x,
const double& y) {
return std::equal_to<double>()(x,y); }
799template<
typename X,
typename Y> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
800bool not_equal_strict(
const X& x,
const Y& y) {
return x != y; }
802#if !defined(EIGEN_GPU_COMPILE_PHASE) || (!defined(EIGEN_CUDA_ARCH) && defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC))
803template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
804bool not_equal_strict(
const float& x,
const float& y) {
return std::not_equal_to<float>()(x,y); }
806template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
807bool not_equal_strict(
const double& x,
const double& y) {
return std::not_equal_to<double>()(x,y); }
Namespace containing all symbols from the Eigen library.
Definition Core:141
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
Definition Constants.h:22