43 #ifndef KOKKOS_FUNCTIONAL_HPP
44 #define KOKKOS_FUNCTIONAL_HPP
46 #include <Kokkos_Macros.hpp>
47 #include <impl/Kokkos_Functional_impl.hpp>
55 typedef T argument_type;
56 typedef T first_argument_type;
57 typedef uint32_t second_argument_type;
58 typedef uint32_t result_type;
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 typedef T first_argument_type;
74 typedef T second_argument_type;
75 typedef bool result_type;
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 typedef T first_argument_type;
86 typedef T second_argument_type;
87 typedef bool result_type;
89 KOKKOS_FORCEINLINE_FUNCTION
90 bool operator()(T
const& a, T
const& b)
const {
91 return !Impl::bitwise_equal(&a, &b);
97 typedef T first_argument_type;
98 typedef T second_argument_type;
99 typedef bool result_type;
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 typedef T first_argument_type;
108 typedef T second_argument_type;
109 typedef bool result_type;
111 KOKKOS_FORCEINLINE_FUNCTION
112 bool operator()(T
const& a, T
const& b)
const {
return a != b; }
115 template <
typename T>
117 typedef T first_argument_type;
118 typedef T second_argument_type;
119 typedef bool result_type;
121 KOKKOS_FORCEINLINE_FUNCTION
122 bool operator()(T
const& a, T
const& b)
const {
return a > b; }
125 template <
typename T>
127 typedef T first_argument_type;
128 typedef T second_argument_type;
129 typedef bool result_type;
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 typedef T first_argument_type;
138 typedef T second_argument_type;
139 typedef bool result_type;
141 KOKKOS_FORCEINLINE_FUNCTION
142 bool operator()(T
const& a, T
const& b)
const {
return a >= b; }
145 template <
typename T>
147 typedef T first_argument_type;
148 typedef T second_argument_type;
149 typedef bool result_type;
151 KOKKOS_FORCEINLINE_FUNCTION
152 bool operator()(T
const& a, T
const& b)
const {
return a <= b; }
157 #endif // KOKKOS_FUNCTIONAL_HPP