Skip to content

Commit

Permalink
add rounded ops declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkichler committed Feb 20, 2025
1 parent 8d6548b commit 72afa00
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/cuinterval/arithmetic/intrinsic.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
namespace cu::intrinsic
{
// clang-format off
#define ROUNDED_OP(OP) \
template<typename T> inline constexpr __device__ T OP ## _down(const T &x, typename T::value_type y); \
template<typename T> inline constexpr __device__ T OP ## _up (const T &x, typename T::value_type y); \
template<typename T> inline constexpr __device__ T OP ## _down(typename T::value_type x, const T &y); \
template<typename T> inline constexpr __device__ T OP ## _up (typename T::value_type x, const T &y); \

ROUNDED_OP(add)
ROUNDED_OP(sub)
ROUNDED_OP(mul)

#undef ROUNDED_OP

template<typename T> inline __device__ T fma_down (T x, T y, T z);
template<typename T> inline __device__ T fma_up (T x, T y, T z);
template<typename T> inline __device__ T add_down (T x, T y);
Expand Down

0 comments on commit 72afa00

Please sign in to comment.