| 80 | } |
| 81 | |
| 82 | static std::vector<int64_t> run_shape_transforms(const std::vector<std::size_t>& dims, |
| 83 | const std::vector<migraphx::operation>& ops) |
| 84 | { |
| 85 | migraphx::shape s{migraphx::shape::int64_type, dims}; |
| 86 | std::vector<int64_t> data(s.elements()); |
| 87 | std::iota(data.begin(), data.end(), 0); |
| 88 | |
| 89 | migraphx::program p; |
| 90 | auto* mm = p.get_main_module(); |
| 91 | auto start = mm->add_literal(s, data); |
| 92 | for(const auto& op : ops) |
| 93 | start = mm->add_instruction(op, start); |
| 94 | mm->add_return({start}); |
| 95 | |
| 96 | auto result = p.eval({}).at(0); |
| 97 | return result.to_vector<int64_t>(); |
| 98 | } |
| 99 | |
| 100 | static std::vector<int64_t> run_strided_view(const migraphx::shape& s, std::int64_t offset) |
| 101 | { |
no test coverage detected