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

Function check_compiled_program

test/multi_target/multitarget_test.cpp:132–159  ·  view source on GitHub ↗

NOLINT

Source from the content-addressed store, hash-verified

130
131// NOLINT
132static bool check_compiled_program(const migraphx::program& p,
133 const std::vector<migraphx::target>& targets)
134{
135 auto mods = p.get_modules();
136 bool check_compiled = true;
137 for(const auto* mod : mods)
138 {
139 for(const auto& ins : *mod)
140 {
141 if(ins.name() == "run_on_target")
142 {
143 auto* mod_input = ins.module_inputs().front();
144 std::size_t target_id =
145 ins.get_operator().to_value()["target_id"].to<std::size_t>();
146 auto target_name = targets.at(target_id).name();
147 if(target_name == "gpu")
148 check_compiled &= is_compiled_gpu_module(*mod_input);
149 else if(target_name == "cpu")
150 check_compiled &= is_compiled_cpu_module(*mod_input);
151 else if(target_name == "fpga")
152 check_compiled &= is_compiled_fpga_module(*mod_input);
153 else if(target_name == "ref")
154 check_compiled &= is_compiled_ref_module(*mod_input);
155 }
156 }
157 }
158 return check_compiled;
159}
160
161TEST_CASE(multitarget_compile_cpu_gpu)
162{

Callers 1

TEST_CASEFunction · 0.85

Calls 9

is_compiled_gpu_moduleFunction · 0.85
is_compiled_cpu_moduleFunction · 0.85
is_compiled_fpga_moduleFunction · 0.85
is_compiled_ref_moduleFunction · 0.85
get_modulesMethod · 0.80
frontMethod · 0.80
atMethod · 0.80
nameMethod · 0.45
to_valueMethod · 0.45

Tested by

no test coverage detected