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

Function verify_instructions

src/driver/verify.cpp:181–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181void verify_instructions(const program& prog,
182 const target& t,
183 compile_options options,
184 const verify_options& vo,
185 verify::tolerance tols)
186{
187 const auto* mm_prog = prog.get_main_module();
188 for(auto&& ins : (*mm_prog))
189 {
190 if(ins.name().front() == '@')
191 continue;
192 if(ins.name() == "broadcast")
193 continue;
194 if(ins.name() == "transpose")
195 continue;
196 if(ins.name() == "reshape")
197 continue;
198 if(ins.name() == "undefined")
199 continue;
200 program p;
201 auto* mm_p = p.get_main_module();
202 std::vector<instruction_ref> inputs;
203 for(auto&& arg : ins.inputs())
204 {
205 if(arg->name() == "@literal")
206 inputs.push_back(mm_p->add_literal(arg->get_literal()));
207 else
208 inputs.push_back(
209 mm_p->add_parameter(std::to_string(inputs.size()), arg->get_shape()));
210 }
211 mm_p->add_instruction(ins.get_operator(), inputs);
212 try
213 {
214 std::cout << "Verify: " << ins.name() << std::endl;
215 std::cout << p << std::endl;
216 verify_program(ins.name(), p, t, options, vo, create_param_map(p, false), tols);
217 }
218 catch(...)
219 {
220 std::cout << "Instruction " << ins.name() << " threw an exception." << std::endl;
221 throw;
222 }
223 }
224}
225
226static bool verify_reduced(program p,
227 int n,

Callers 1

runMethod · 0.85

Calls 13

create_param_mapFunction · 0.85
get_main_moduleMethod · 0.80
frontMethod · 0.80
add_parameterMethod · 0.80
verify_programFunction · 0.70
to_stringFunction · 0.50
nameMethod · 0.45
inputsMethod · 0.45
push_backMethod · 0.45
add_literalMethod · 0.45
sizeMethod · 0.45
get_shapeMethod · 0.45

Tested by

no test coverage detected