| 179 | } |
| 180 | |
| 181 | void 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 | |
| 226 | static bool verify_reduced(program p, |
| 227 | int n, |
no test coverage detected