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
90 KOKKOS_FORCEINLINE_FUNCTION
99 template <
class U,
class V>
100 KOKKOS_FORCEINLINE_FUNCTION
109 template <
class U,
class V>
110 KOKKOS_FORCEINLINE_FUNCTION
119 template <
class U,
class V>
120 KOKKOS_FORCEINLINE_FUNCTION
140 template <
class U,
class V>
141 KOKKOS_FORCEINLINE_FUNCTION
151 template <
class U,
class V>
152 pair(
const std::pair<U,V> &p)
169 template <
class T1,
class T2>
170 struct pair<T1&, T2&>
173 typedef T1& first_type;
175 typedef T2& second_type;
186 KOKKOS_FORCEINLINE_FUNCTION
187 pair(first_type f, second_type s)
188 : first(f), second(s)
195 template <
class U,
class V>
196 KOKKOS_FORCEINLINE_FUNCTION
197 pair(
const pair<U,V> &p)
198 : first(p.first), second(p.second)
202 template <
class U,
class V>
203 pair(
const std::pair<U,V> &p)
204 : first(p.first), second(p.second)
211 template <
class U,
class V>
212 KOKKOS_FORCEINLINE_FUNCTION
213 pair<first_type, second_type> & operator=(
const pair<U,V> &p)
229 std::pair<T1,T2> to_std_pair()
const 233 template <
class T1,
class T2>
237 typedef T1 first_type;
239 typedef T2& second_type;
250 KOKKOS_FORCEINLINE_FUNCTION
251 pair(first_type
const& f, second_type s)
252 : first(f), second(s)
259 template <
class U,
class V>
260 KOKKOS_FORCEINLINE_FUNCTION
261 pair(
const pair<U,V> &p)
262 : first(p.first), second(p.second)
266 template <
class U,
class V>
267 pair(
const std::pair<U,V> &p)
268 : first(p.first), second(p.second)
275 template <
class U,
class V>
276 KOKKOS_FORCEINLINE_FUNCTION
277 pair<first_type, second_type> & operator=(
const pair<U,V> &p)
293 std::pair<T1,T2> to_std_pair()
const 297 template <
class T1,
class T2>
301 typedef T1& first_type;
303 typedef T2 second_type;
314 KOKKOS_FORCEINLINE_FUNCTION
315 pair(first_type f, second_type
const& s)
316 : first(f), second(s)
323 template <
class U,
class V>
324 KOKKOS_FORCEINLINE_FUNCTION
325 pair(
const pair<U,V> &p)
326 : first(p.first), second(p.second)
330 template <
class U,
class V>
331 pair(
const std::pair<U,V> &p)
332 : first(p.first), second(p.second)
339 template <
class U,
class V>
340 KOKKOS_FORCEINLINE_FUNCTION
341 pair<first_type, second_type> & operator=(
const pair<U,V> &p)
357 std::pair<T1,T2> to_std_pair()
const 362 template <
class T1,
class T2>
363 KOKKOS_FORCEINLINE_FUNCTION
368 template <
class T1,
class T2>
369 KOKKOS_FORCEINLINE_FUNCTION
371 {
return !(lhs==rhs); }
374 template <
class T1,
class T2>
375 KOKKOS_FORCEINLINE_FUNCTION
377 {
return lhs.
first<rhs.first || (!(rhs.first<lhs.first) && lhs.second<rhs.second); }
380 template <
class T1,
class T2>
381 KOKKOS_FORCEINLINE_FUNCTION
383 {
return !(rhs<lhs); }
386 template <
class T1,
class T2>
387 KOKKOS_FORCEINLINE_FUNCTION
392 template <
class T1,
class T2>
393 KOKKOS_FORCEINLINE_FUNCTION
395 {
return !(lhs<rhs); }
401 template <
class T1,
class T2>
402 KOKKOS_FORCEINLINE_FUNCTION
445 template <
class T1,
class T2>
446 KOKKOS_FORCEINLINE_FUNCTION
463 KOKKOS_FORCEINLINE_FUNCTION
468 KOKKOS_FORCEINLINE_FUNCTION
473 KOKKOS_FORCEINLINE_FUNCTION
479 KOKKOS_FORCEINLINE_FUNCTION
480 pair(
const pair<U,void> &p)
485 KOKKOS_FORCEINLINE_FUNCTION
486 pair<T1, void> &
operator=(
const pair<U,void> &p)
498 KOKKOS_FORCEINLINE_FUNCTION
499 bool operator== (
const pair<T1,void>& lhs,
const pair<T1,void>& rhs)
500 {
return lhs.first==rhs.first; }
503 KOKKOS_FORCEINLINE_FUNCTION
504 bool operator!= (
const pair<T1,void>& lhs,
const pair<T1,void>& rhs)
505 {
return !(lhs==rhs); }
508 KOKKOS_FORCEINLINE_FUNCTION
509 bool operator< (const pair<T1,void>& lhs,
const pair<T1,void>& rhs)
510 {
return lhs.first<rhs.first; }
513 KOKKOS_FORCEINLINE_FUNCTION
514 bool operator<= (const pair<T1,void>& lhs,
const pair<T1,void>& rhs)
515 {
return !(rhs<lhs); }
518 KOKKOS_FORCEINLINE_FUNCTION
519 bool operator> (
const pair<T1,void>& lhs,
const pair<T1,void>& rhs)
523 KOKKOS_FORCEINLINE_FUNCTION
524 bool operator>= (
const pair<T1,void>& lhs,
const pair<T1,void>& rhs)
525 {
return !(lhs<rhs); }
530 #endif //KOKKOS_PAIR_HPP KOKKOS_FORCEINLINE_FUNCTION pair()
Default constructor.
KOKKOS_INLINE_FUNCTION bool operator!=(const complex< RealType > &x, const complex< RealType > &y)
Inequality operator for two complex numbers.
KOKKOS_FORCEINLINE_FUNCTION pair(const volatile pair< U, V > &p)
Copy constructor.
T2 second_type
The second template parameter of this class.
Replacement for std::pair that works on CUDA devices.
KOKKOS_FORCEINLINE_FUNCTION pair(first_type const &f, second_type const &s)
Constructor that takes both elements of the pair.
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 bool operator>(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Greater-than operator for Kokkos::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 bool operator>=(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Greater-than-or-equal-to 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 pair(const pair< U, V > &p)
Copy constructor.
second_type second
The second element of the pair.
KOKKOS_FORCEINLINE_FUNCTION pair< T1, T2 > make_pair(T1 x, T2 y)
Return a new pair.
KOKKOS_FORCEINLINE_FUNCTION pair< T1, T2 > & operator=(const pair< U, V > &p)
Assignment operator.