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

Function gcd

include/cutlass/fast_math.h:167–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165 */
166template <typename value_t>
167CUTLASS_HOST_DEVICE
168CUTLASS_CONSTEXPR_IF_CXX17
169value_t gcd(value_t a, value_t b) {
170 for (;;) {
171 if (a == value_t{0}) return cutlass::abs_for_integer(b);
172 b %= a;
173 if (b == value_t{0}) return cutlass::abs_for_integer(a);
174 a %= b;
175 }
176}
177
178/**
179 * Least common multiple

Callers 4

sm90_epilogue_tileMethod · 0.90
__mod__Method · 0.90
lcmFunction · 0.70
valueMethod · 0.50

Calls 1

abs_for_integerFunction · 0.85

Tested by

no test coverage detected