Browse Source

!15335 kernel registry bug

From: @ling_qiao_min
Reviewed-by: @zhang_xue_tong,@zhanghaibo5
Signed-off-by: @zhang_xue_tong
pull/15335/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
9e6f9aa56a
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      mindspore/lite/src/kernel_registry.cc

+ 2
- 2
mindspore/lite/src/kernel_registry.cc View File

@@ -39,11 +39,11 @@ KernelRegistry *KernelRegistry::GetInstance() {

std::unique_lock<std::mutex> malloc_creator_array(instance.lock_);
if (instance.creator_arrays_ == nullptr) {
instance.creator_arrays_ = reinterpret_cast<KernelCreator *>(malloc(array_size_ * sizeof(KernelRegistry)));
instance.creator_arrays_ = reinterpret_cast<KernelCreator *>(malloc(array_size_ * sizeof(KernelCreator)));
if (instance.creator_arrays_ == nullptr) {
return nullptr;
}
memset(instance.creator_arrays_, 0, array_size_ * sizeof(KernelRegistry));
memset(instance.creator_arrays_, 0, array_size_ * sizeof(KernelCreator));
}
return &instance;
}


Loading…
Cancel
Save