MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / make_scan_slice_program

Function make_scan_slice_program

test/ref/scan_slice.cpp:40–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40static 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
62TEST_CASE(scan_slice_test_1)
63{

Callers 1

TEST_CASEFunction · 0.85

Calls 11

iotaFunction · 0.85
make_targetFunction · 0.85
get_main_moduleMethod · 0.80
add_parameterMethod · 0.80
make_opFunction · 0.50
elementsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
add_literalMethod · 0.45
add_instructionMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected