diff --git a/lite/core/mir/type_layout_cast_pass.cc b/lite/core/mir/type_layout_cast_pass.cc index 44b6eaf1eb0c5c96630dd66d129919b40f3ea8c6..c1529aacf85c713c6c381974c408b536c608fa61 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; }