From fea3f17d88b63bf3bd53f38bfa02a11c016ec9d8 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