| 147 | } |
| 148 | |
| 149 | bool 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 | |
| 181 | void verify_instructions(const program& prog, |
| 182 | const target& t, |
no test coverage detected