43 #ifndef KOKKOS_FUNCTIONAL_HPP 44 #define KOKKOS_FUNCTIONAL_HPP 46 #include <Kokkos_Macros.hpp> 47 #include <impl/Kokkos_Functional_impl.hpp> 55 using argument_type = T;
56 using first_argument_type = T;
57 using second_argument_type = uint32_t;
58 using result_type = uint32_t;
60 KOKKOS_FORCEINLINE_FUNCTION
61 uint32_t operator()(T
const& t)
const {
62 return Impl::MurmurHash3_x86_32(&t,
sizeof(T), 0);
65 KOKKOS_FORCEINLINE_FUNCTION
66 uint32_t operator()(T
const& t, uint32_t seed)
const {
67 return Impl::MurmurHash3_x86_32(&t,
sizeof(T), seed);
73 using first_argument_type = T;
74 using second_argument_type = T;
75 using result_type = bool;
77 KOKKOS_FORCEINLINE_FUNCTION
78 bool operator()(T
const& a, T
const& b)
const {
79 return Impl::bitwise_equal(&a, &b);
84 struct pod_not_equal_to {
85 using first_argument_type = T;
86 using second_argument_type = T;
87 using result_type = bool;
89 KOKKOS_FORCEINLINE_FUNCTION
90 bool operator()(T
const& a, T
const& b)
const {
91 return !Impl::bitwise_equal(&a, &b);
97 using first_argument_type = T;
98 using second_argument_type = T;
99 using result_type = bool;
101 KOKKOS_FORCEINLINE_FUNCTION
102 bool operator()(T
const& a, T
const& b)
const {
return a == b; }
105 template <
typename T>
106 struct not_equal_to {
107 using first_argument_type = T;
108 using second_argument_type = T;
109 using result_type = bool;
111 KOKKOS_FORCEINLINE_FUNCTION
112 bool operator()(T
const& a, T
const& b)
const {
return a != b; }
115 template <
typename T>
117 using first_argument_type = T;
118 using second_argument_type = T;
119 using result_type = bool;
121 KOKKOS_FORCEINLINE_FUNCTION
122 bool operator()(T
const& a, T
const& b)
const {
return a > b; }
125 template <
typename T>
127 using first_argument_type = T;
128 using second_argument_type = T;
129 using result_type = bool;
131 KOKKOS_FORCEINLINE_FUNCTION
132 bool operator()(T
const& a, T
const& b)
const {
return a < b; }
135 template <
typename T>
136 struct greater_equal {
137 using first_argument_type = T;
138 using second_argument_type = T;
139 using result_type = bool;
141 KOKKOS_FORCEINLINE_FUNCTION
142 bool operator()(T
const& a, T
const& b)
const {
return a >= b; }
145 template <
typename T>
147 using first_argument_type = T;
148 using second_argument_type = T;
149 using result_type = bool;
151 KOKKOS_FORCEINLINE_FUNCTION
152 bool operator()(T
const& a, T
const& b)
const {
return a <= b; }
157 #endif // KOKKOS_FUNCTIONAL_HPP