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

Function lcm

include/cutlass/fast_math.h:182–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180 */
181template <typename value_t>
182CUTLASS_HOST_DEVICE
183CUTLASS_CONSTEXPR_IF_CXX17
184value_t lcm(value_t a, value_t b) {
185 value_t temp = cutlass::gcd(a, b);
186 return (temp != value_t{0}) ? value_t(cutlass::abs_for_integer(a) / temp * cutlass::abs_for_integer(b)) : value_t{};
187}
188
189/**
190 * Greatest common divisor

Callers 4

TestSmallFunction · 0.85
TESTFunction · 0.85

Calls 2

abs_for_integerFunction · 0.85
gcdFunction · 0.70

Tested by 1

TestSmallFunction · 0.68