MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / repeat_while_changes

Method repeat_while_changes

src/module.cpp:1644–1661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1642}
1643
1644void module::repeat_while_changes(std::size_t n, const std::function<void()>& f)
1645{
1646 if(n == 0)
1647 return;
1648 if(n == 1)
1649 {
1650 f();
1651 return;
1652 }
1653 auto has_changed = impl->changed.subscribe();
1654 for(auto i : range(n))
1655 {
1656 f();
1657 if(not has_changed)
1658 break;
1659 (void)i;
1660 }
1661}
1662
1663// Hoists external inputs (instructions not in the dependency chain between start_ins and end_ins)
1664// to before start_ins, while preserving topological order

Callers 3

applyMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80

Calls 2

subscribeMethod · 0.80
rangeFunction · 0.50

Tested by

no test coverage detected