forked from mindspore-Ecosystem/mindspore
fix kernel_build_info is nullptr
This commit is contained in:
parent
984a92c0b8
commit
a0fcfb08f5
|
@ -191,10 +191,14 @@ void CallbackImpl::SetEmptyKernelInfo(const AnfNodePtr &node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallbackImpl::ResetKernelInfo(const AnfNodePtr &node) {
|
void CallbackImpl::ResetKernelInfo(const AnfNodePtr &node) {
|
||||||
|
MS_EXCEPTION_IF_NULL(node);
|
||||||
auto cnode = node->cast<CNodePtr>();
|
auto cnode = node->cast<CNodePtr>();
|
||||||
MS_EXCEPTION_IF_NULL(cnode);
|
MS_EXCEPTION_IF_NULL(cnode);
|
||||||
if (GetTargetFromContext() == kAscendDevice) {
|
if (GetTargetFromContext() == kAscendDevice) {
|
||||||
|
auto kernel_info = cnode->kernel_info_ptr();
|
||||||
|
if (kernel_info == nullptr) {
|
||||||
cnode->set_kernel_info(std::make_shared<device::KernelInfo>());
|
cnode->set_kernel_info(std::make_shared<device::KernelInfo>());
|
||||||
|
}
|
||||||
auto kernel_info_setter = GraphKernelInfoManager::Instance().GetGraphKernelInfo(kAscendDevice);
|
auto kernel_info_setter = GraphKernelInfoManager::Instance().GetGraphKernelInfo(kAscendDevice);
|
||||||
MS_EXCEPTION_IF_NULL(kernel_info_setter);
|
MS_EXCEPTION_IF_NULL(kernel_info_setter);
|
||||||
kernel_info_setter->SetKernelInfo(cnode, KernelType::UNKNOWN_KERNEL_TYPE);
|
kernel_info_setter->SetKernelInfo(cnode, KernelType::UNKNOWN_KERNEL_TYPE);
|
||||||
|
|
Loading…
Reference in New Issue