| 54 | |
| 55 | template <class... Ts> |
| 56 | static void throws_shape(const migraphx::operation& op, Ts... xs) |
| 57 | { |
| 58 | migraphx::program p; |
| 59 | auto* mm = p.get_main_module(); |
| 60 | std::vector<migraphx::shape> shapes{xs...}; |
| 61 | std::vector<migraphx::instruction_ref> args(shapes.size()); |
| 62 | std::transform( |
| 63 | shapes.begin(), shapes.end(), args.begin(), [&](auto&& s) { return mm->add_outline(s); }); |
| 64 | bool thrown = test::throws([&] { mm->add_instruction(op, args); }); |
| 65 | if(not thrown) |
| 66 | { |
| 67 | std::cout << "FAILED: No error found for " << op.name() << ": "; |
| 68 | for(auto&& s : shapes) |
| 69 | std::cout << " " << s << std::endl; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | template <class...> |
| 74 | struct always_false : std::false_type |
no test coverage detected