提交 0d7e1306 编写于 作者: X xmyqsh 提交者: GitHub

add auto registration checker for Kernel

Former-commit-id: 47a88281180e5c23eb1b002358e5907fa6d854af
上级 b0ede4ee
......@@ -144,7 +144,9 @@ std::unique_ptr<const Kernel> ConstructKernel(const JobDesc* job_desc, const Ker
DeviceCtx* device_ctx) {
auto op_type = conf.op_attribute().op_conf().op_type_case();
Kernel* rptr = kernel_registration::CreateKernel(conf);
if (rptr == nullptr) { rptr = NewObj<int32_t, Kernel>(op_type, conf); }
if (rptr == nullptr && IsClassRegistered<int32_t, Kernel>(op_type, conf)) {
rptr = NewObj<int32_t, Kernel>(op_type, conf);
}
CHECK_NOTNULL(rptr);
rptr->Init(job_desc, conf, device_ctx);
return std::unique_ptr<const Kernel>(rptr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册