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

Function run_prog

test/gpu/codegen_literal.cpp:30–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28#include <migraphx/make_op.hpp>
29
30static void run_prog(migraphx::program p,
31 const migraphx::target& t,
32 migraphx::parameter_map& m_in,
33 std::vector<float>& res)
34{
35 p.compile(t);
36 migraphx::parameter_map m;
37 for(auto&& x : p.get_parameter_shapes())
38 {
39 if(m_in.count(x.first) > 0)
40 {
41 m[x.first] = t.copy_to(m_in[x.first]);
42 }
43 else
44 {
45 m[x.first] = t.allocate(x.second);
46 }
47 }
48
49 auto result = t.copy_from(p.eval(m).back());
50 result.visit([&](auto v) { res.assign(v.begin(), v.end()); });
51}
52
53// This test ensures that the codegen path doesn't round up literals,
54// otherwise there are accuracy differences compared to ref.

Callers 2

TEST_CASEFunction · 0.70
TEST_CASEFunction · 0.70

Calls 11

backMethod · 0.80
compileMethod · 0.45
get_parameter_shapesMethod · 0.45
copy_toMethod · 0.45
allocateMethod · 0.45
copy_fromMethod · 0.45
evalMethod · 0.45
visitMethod · 0.45
assignMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected