| 127 | } |
| 128 | |
| 129 | HalideExecutable::FunctionHandle HalideExecutable::compile_and_load( |
| 130 | CompNode comp_node) const { |
| 131 | Target target = get_host_target(); |
| 132 | auto req_features = m_target_trait->features(comp_node); |
| 133 | target.set_feature(Target::UserContext); |
| 134 | if (MGB_GETENV("MGB_HALIDE_DEBUG")) { |
| 135 | target.set_feature(Target::Debug); |
| 136 | } |
| 137 | for (size_t i = 0; i < req_features.size(); ++i) { |
| 138 | if (req_features.test(i)) { |
| 139 | target.set_feature(static_cast<Target::Feature>(i)); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | return m_target_trait->compile_and_load(comp_node, target, *this); |
| 144 | } |
| 145 | |
| 146 | void HalideExecutable::invoke( |
| 147 | void* user_context, const FunctionHandle& handle, const VarNodeArray& inputs, |