| 38 | } |
| 39 | |
| 40 | static migraphx::program make_scan_slice_program(int64_t axis, int64_t direction) |
| 41 | { |
| 42 | migraphx::program p; |
| 43 | auto* mm = p.get_main_module(); |
| 44 | |
| 45 | migraphx::shape data_sh{migraphx::shape::int32_type, {2, 2, 2}}; |
| 46 | std::vector<int> data(data_sh.elements()); |
| 47 | std::iota(data.begin(), data.end(), 0); |
| 48 | auto data_lit = mm->add_literal(migraphx::literal{data_sh, data}); |
| 49 | |
| 50 | migraphx::shape idx_sh{migraphx::shape::int64_type, {1}}; |
| 51 | auto idx_param = mm->add_parameter("idx", idx_sh); |
| 52 | |
| 53 | mm->add_instruction(migraphx::make_op("scan_slice", {{"axis", axis}, {"direction", direction}}), |
| 54 | data_lit, |
| 55 | idx_param); |
| 56 | |
| 57 | p.compile(migraphx::make_target("ref")); |
| 58 | |
| 59 | return p; |
| 60 | } |
| 61 | |
| 62 | TEST_CASE(scan_slice_test_1) |
| 63 | { |
no test coverage detected