MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / abs

Function abs

include/cute/numeric/math.hpp:65–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63template <class T,
64 __CUTE_REQUIRES(is_arithmetic<T>::value)>
65CUTE_HOST_DEVICE constexpr
66auto
67abs(T const& t) {
68 if constexpr (is_signed<T>::value) {
69 return t < T(0) ? -t : t;
70 } else {
71 return t;
72 }
73
74 CUTE_GCC_UNREACHABLE;
75}
76
77// Returns 1 if x > 0, -1 if x < 0, and 0 if x is zero.
78template <class T,

Callers 9

RClass · 0.70
composition_implFunction · 0.50
upcastFunction · 0.50
make_layoutFunction · 0.50
transfer_swizzleFunction · 0.50
slice_and_offsetFunction · 0.50
logical_productFunction · 0.50
SwizzleClass · 0.50
make_column_zero_maskFunction · 0.50

Calls 1

TClass · 0.85

Tested by

no test coverage detected