From b92e8c4299a7b71cff8923d5354ef390b0769fae Mon Sep 17 00:00:00 2001 From: ysh329 Date: Thu, 24 Sep 2020 09:59:49 +0800 Subject: [PATCH] [PASS][BugFix] Fix layout pass for opencl when convert model. test=develop (#4425) --- lite/core/mir/type_layout_cast_pass.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lite/core/mir/type_layout_cast_pass.cc b/lite/core/mir/type_layout_cast_pass.cc index 44b6eaf1eb..c1529aacf8 100644 --- a/lite/core/mir/type_layout_cast_pass.cc +++ b/lite/core/mir/type_layout_cast_pass.cc @@ -82,8 +82,11 @@ void TypeLayoutTransformPass::ComplementInputs(SSAGraph* graph, // not a good judge, but don't find the source of this issue from // static_pick_kernel_pass // to this pass. + auto is_host = [](TargetType x) -> bool { + return x == TARGET(kHost) || x == TARGET(kX86) || x == TARGET(kARM); + }; auto* in_arg_type = const_cast(in->AsArg().type); - if (in_arg_type->target() == TARGET(kARM) && + if (is_host(in_arg_type->target()) && in_arg_type->layout() == DATALAYOUT(kImageDefault)) { return; } -- GitLab