MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / gcd

Function gcd

src/gopt/impl/global_layout_transform/reformat_manager.cpp:12–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11namespace {
12static inline int gcd(const int& p, const int& q) {
13 int x = p, y = q;
14 while (y != 0) {
15 if (x < y) {
16 y = (y % x);
17 } else {
18 x = (x % y);
19 std::swap(x, y);
20 }
21 }
22 return x;
23}
24
25static inline size_t extra_alignment(
26 ReformatManager::ReformatKey::Attribute attr, TensorFormats target_formats,

Callers 5

extra_alignmentFunction · 0.85
try_copy_last_contigMethod · 0.85
try_copy_last_contigMethod · 0.85

Calls 1

swapFunction · 0.85

Tested by

no test coverage detected