more utility code

This commit is contained in:
Chao Liu
2019-09-09 00:29:33 -05:00
parent 625838def0
commit 7a7fe16086
21 changed files with 824 additions and 455 deletions

View File

@@ -104,6 +104,18 @@ __host__ __device__ constexpr T lcm(T x, Ts... xs)
return max(x, xs...);
}
template <class T>
struct equal
{
__host__ __device__ constexpr bool operator()(T x, T y) const { return x == y; }
};
template <class T>
struct less
{
__host__ __device__ constexpr bool operator()(T x, T y) const { return x < y; }
};
} // namespace math
} // namspace ck