@@ -59,14 +59,20 @@ status_t compile_ops(std::shared_ptr<subgraph_t> &sg) {
59
59
auto cur_op = op->shared_from_this ();
60
60
auto creator = opm->get_additional_item <executable_creator_func>(
61
61
" executable_creator" );
62
- std::shared_ptr<op_executable_t > exec
63
- = creator (cur_op, p_engine, mgr, pd_cache);
64
62
65
- VCHECK_COMPILE_OPS (exec != nullptr , status::invalid_graph_op,
66
- " unimplemented op, can't compile op %s" ,
67
- op->get_name ().c_str ());
63
+ try {
64
+ std::shared_ptr<op_executable_t > exec
65
+ = creator (cur_op, p_engine, mgr, pd_cache);
66
+ VCHECK_COMPILE_OPS (exec != nullptr , status::invalid_graph_op,
67
+ " unimplemented op, can't compile op %s" ,
68
+ op->get_name ().c_str ());
68
69
69
- sg->execs_ .emplace_back (exec);
70
+ sg->execs_ .emplace_back (exec);
71
+ } catch (const std::runtime_error &e) {
72
+ VCHECK_COMPILE_OPS (false , status::unimplemented,
73
+ " failed to create executable for op %s: %s" ,
74
+ op->get_name ().c_str (), e.what ());
75
+ }
70
76
sg->is_constant_ .push_back (op->has_attr (op_attr::is_constant)
71
77
&& op->get_attr <bool >(op_attr::is_constant));
72
78
return status::success;
0 commit comments