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

Function verify_program

src/driver/verify.cpp:149–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149bool verify_program(const std::string& name,
150 const program& p,
151 const target& t,
152 compile_options options,
153 const verify_options& vo,
154 const parameter_map& inputs,
155 verify::tolerance tols)
156{
157 auto ref_outs = run_ref(p, options, vo, inputs);
158 auto target_outs = run_target(p, t, options, vo, inputs);
159
160 std::size_t output_num = ref_outs.size();
161 bool passed = true;
162 for(std::size_t i = 0; i < output_num; ++i)
163 {
164 if(ref_outs[i].get_shape().type() != target_outs[i].get_shape().type() or
165 ref_outs[i].get_shape().lens() != target_outs[i].get_shape().lens())
166 {
167 std::cout << "FAILED: " << name << std::endl;
168 std::cout << "Shape mismatch {" << ref_outs[i].get_shape() << "} != {"
169 << target_outs[i].get_shape() << "}" << std::endl;
170 }
171 else
172 {
173 passed &= verify_args(name, target_outs[i], verify::expected{ref_outs[i]}, tols);
174 }
175 }
176 if(passed)
177 std::cout << "MIGraphX verification passed successfully." << std::endl;
178 return passed;
179}
180
181void verify_instructions(const program& prog,
182 const target& t,

Callers 3

verify_instructionsFunction · 0.70
verify_reducedFunction · 0.70
runMethod · 0.70

Calls 7

run_targetFunction · 0.85
verify_argsFunction · 0.85
lensMethod · 0.80
run_refFunction · 0.70
sizeMethod · 0.45
typeMethod · 0.45
get_shapeMethod · 0.45

Tested by

no test coverage detected