NOLINT
| 130 | |
| 131 | // NOLINT |
| 132 | static 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 | |
| 161 | TEST_CASE(multitarget_compile_cpu_gpu) |
| 162 | { |
no test coverage detected