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

Method find_splits

src/split_reduce.cpp:91–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90
91 std::vector<instruction_ref> find_splits() const
92 {
93 std::vector<instruction_ref> result;
94 copy_if(iterator_for(*rm), std::back_inserter(result), [](auto ins) {
95 return is_reduce(*ins);
96 });
97 if(result.size() > 2)
98 return {};
99 // Only handle reduce_sum for now
100 // TODO: Support other reduction types
101 if(not std::all_of(result.begin(), result.end(), [](instruction_ref ins) {
102 return ins->name() == "reduce_sum";
103 }))
104 return {};
105 if(result.size() < 2)
106 return result;
107 if(reaches(result[0], result[1]))
108 return {};
109 return result;
110 }
111
112 std::vector<instruction_ref> find_alive(const std::vector<instruction_ref>& splits)
113 {

Callers 1

applyMethod · 0.80

Calls 9

iterator_forFunction · 0.85
reachesFunction · 0.85
is_reduceFunction · 0.70
copy_ifFunction · 0.50
all_ofFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected