48 #ifndef KOKKOS_PAIR_HPP 49 #define KOKKOS_PAIR_HPP 51 #include <Kokkos_Macros.hpp> 63 template <
class T1,
class T2>
81 KOKKOS_FORCEINLINE_FUNCTION constexpr
88 KOKKOS_FORCEINLINE_FUNCTION constexpr
89 pair(first_type
const& f, second_type
const& s)
97 template <
class U,
class V>
98 KOKKOS_FORCEINLINE_FUNCTION constexpr
100 : first(p.first), second(p.second)
107 template <
class U,
class V>
108 KOKKOS_FORCEINLINE_FUNCTION constexpr
110 : first(p.first), second(p.second)
117 template <
class U,
class V>
118 KOKKOS_FORCEINLINE_FUNCTION
138 template <
class U,
class V>
139 KOKKOS_FORCEINLINE_FUNCTION
149 template <
class U,
class V>
150 pair(
const std::pair<U,V> &p)
167 template <
class T1,
class T2>
168 struct pair<T1&, T2&>
184 KOKKOS_FORCEINLINE_FUNCTION constexpr
185 pair(first_type f, second_type s)
193 template <
class U,
class V>
194 KOKKOS_FORCEINLINE_FUNCTION constexpr
200 template <
class U,
class V>
201 pair(
const std::pair<U,V> &p)
209 template <
class U,
class V>
210 KOKKOS_FORCEINLINE_FUNCTION
231 template <
class T1,
class T2>
248 KOKKOS_FORCEINLINE_FUNCTION constexpr
249 pair(first_type
const& f, second_type s)
257 template <
class U,
class V>
258 KOKKOS_FORCEINLINE_FUNCTION constexpr
264 template <
class U,
class V>
265 pair(
const std::pair<U,V> &p)
273 template <
class U,
class V>
274 KOKKOS_FORCEINLINE_FUNCTION
295 template <
class T1,
class T2>
312 KOKKOS_FORCEINLINE_FUNCTION constexpr
313 pair(first_type f, second_type
const& s)
321 template <
class U,
class V>
322 KOKKOS_FORCEINLINE_FUNCTION constexpr
328 template <
class U,
class V>
329 pair(
const std::pair<U,V> &p)
337 template <
class U,
class V>
338 KOKKOS_FORCEINLINE_FUNCTION
360 template <
class T1,
class T2>
361 KOKKOS_FORCEINLINE_FUNCTION
366 template <
class T1,
class T2>
367 KOKKOS_FORCEINLINE_FUNCTION constexpr
369 {
return !(lhs==rhs); }
372 template <
class T1,
class T2>
373 KOKKOS_FORCEINLINE_FUNCTION constexpr
375 {
return lhs.
first<rhs.first || (!(rhs.first<lhs.first) && lhs.second<rhs.second); }
378 template <
class T1,
class T2>
379 KOKKOS_FORCEINLINE_FUNCTION constexpr
381 {
return !(rhs<lhs); }
384 template <
class T1,
class T2>
385 KOKKOS_FORCEINLINE_FUNCTION constexpr
390 template <
class T1,
class T2>
391 KOKKOS_FORCEINLINE_FUNCTION constexpr
393 {
return !(lhs<rhs); }
399 template <
class T1,
class T2>
400 KOKKOS_FORCEINLINE_FUNCTION constexpr
443 template <
class T1,
class T2>
444 KOKKOS_FORCEINLINE_FUNCTION
461 KOKKOS_FORCEINLINE_FUNCTION constexpr
464 KOKKOS_FORCEINLINE_FUNCTION constexpr
465 pair(
const first_type & f)
469 KOKKOS_FORCEINLINE_FUNCTION constexpr
470 pair(
const first_type & f,
int)
475 KOKKOS_FORCEINLINE_FUNCTION constexpr
481 KOKKOS_FORCEINLINE_FUNCTION
494 KOKKOS_FORCEINLINE_FUNCTION constexpr
499 KOKKOS_FORCEINLINE_FUNCTION constexpr
501 {
return !(lhs==rhs); }
504 KOKKOS_FORCEINLINE_FUNCTION constexpr
505 bool operator< (const pair<T1,void>& lhs,
const pair<T1,void>& rhs)
509 KOKKOS_FORCEINLINE_FUNCTION constexpr
510 bool operator<= (const pair<T1,void>& lhs,
const pair<T1,void>& rhs)
511 {
return !(rhs<lhs); }
514 KOKKOS_FORCEINLINE_FUNCTION constexpr
519 KOKKOS_FORCEINLINE_FUNCTION constexpr
521 {
return !(lhs<rhs); }
526 #endif //KOKKOS_PAIR_HPP KOKKOS_FORCEINLINE_FUNCTION constexpr bool operator>=(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Greater-than-or-equal-to operator for Kokkos::pair.
KOKKOS_FORCEINLINE_FUNCTION constexpr pair(const volatile pair< U, V > &p)
Copy constructor.
KOKKOS_INLINE_FUNCTION bool operator!=(const complex< RealType > &x, const complex< RealType > &y)
Inequality operator for two complex numbers.
T2 second_type
The second template parameter of this class.
Replacement for std::pair that works on CUDA devices.
std::pair< T1, T2 > to_std_pair() const
Return the std::pair version of this object.
first_type first
The first element of the pair.
KOKKOS_FORCEINLINE_FUNCTION constexpr pair(first_type const &f, second_type const &s)
Constructor that takes both elements of the pair.
T1 first_type
The first template parameter of this class.
KOKKOS_FORCEINLINE_FUNCTION void operator=(const volatile pair< U, V > &p) volatile
Assignment operator, for volatile *this.
KOKKOS_INLINE_FUNCTION bool operator==(const complex< RealType > &x, const complex< RealType > &y)
Equality operator for two complex numbers.
KOKKOS_FORCEINLINE_FUNCTION constexpr pair< T1, T2 > make_pair(T1 x, T2 y)
Return a new pair.
KOKKOS_FORCEINLINE_FUNCTION constexpr bool operator>(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Greater-than operator for Kokkos::pair.
KOKKOS_FORCEINLINE_FUNCTION pair< T1 &, T2 & > tie(T1 &x, T2 &y)
Return a pair of references to the input arguments.
KOKKOS_FORCEINLINE_FUNCTION constexpr pair(const pair< U, V > &p)
Copy constructor.
second_type second
The second element of the pair.
KOKKOS_FORCEINLINE_FUNCTION pair< T1, T2 > & operator=(const pair< U, V > &p)
Assignment operator.
KOKKOS_FORCEINLINE_FUNCTION constexpr pair()=default
Default constructor.