From 091b2661b3da3fcbc8f5eafbd2d0d88bb9338d53 Mon Sep 17 00:00:00 2001 From: liuruilong Date: Sun, 14 Oct 2018 20:17:58 +0800 Subject: [PATCH] fix feed input crash --- src/framework/executor.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/framework/executor.cpp b/src/framework/executor.cpp index 3716e8d5df..27052de2fd 100644 --- a/src/framework/executor.cpp +++ b/src/framework/executor.cpp @@ -908,10 +908,14 @@ void Executor::InitMemory() { for (const auto &var_desc : block->Vars()) { auto var = program_.scope->Var(var_desc->Name()); if (var_desc->Persistable()) { - auto cl_image = var->template GetMutable(); + CLImage *cl_image = nullptr; if (var_desc->Name() == "feed" || var_desc->Name() == "fetch") { + var->template GetMutable(); continue; + } else { + cl_image = var->template GetMutable(); } + char *origin_data = Get_binary_data(program_.model_path + "/" + var_desc->Name()); char *data = origin_data; @@ -966,9 +970,12 @@ void Executor::InitCombineMemory() { for (const auto &var_desc : block->Vars()) { auto var = program_.scope->Var(var_desc->Name()); if (var_desc->Persistable()) { - auto cl_image = var->template GetMutable(); + CLImage *cl_image = nullptr; if (var_desc->Name() == "feed" || var_desc->Name() == "fetch") { + var->template GetMutable(); continue; + } else { + cl_image = var->template GetMutable(); } cl_context context = program_.scope->GetCLScpoe()->Context(); -- GitLab