未验证 提交 b92e8c42 编写于 作者: Y ysh329 提交者: GitHub

[PASS][BugFix] Fix layout pass for opencl when convert model. test=develop (#4425)

上级 b40fc45f
...@@ -82,8 +82,11 @@ void TypeLayoutTransformPass::ComplementInputs(SSAGraph* graph, ...@@ -82,8 +82,11 @@ void TypeLayoutTransformPass::ComplementInputs(SSAGraph* graph,
// not a good judge, but don't find the source of this issue from // not a good judge, but don't find the source of this issue from
// static_pick_kernel_pass // static_pick_kernel_pass
// to this 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<Type*>(in->AsArg().type); auto* in_arg_type = const_cast<Type*>(in->AsArg().type);
if (in_arg_type->target() == TARGET(kARM) && if (is_host(in_arg_type->target()) &&
in_arg_type->layout() == DATALAYOUT(kImageDefault)) { in_arg_type->layout() == DATALAYOUT(kImageDefault)) {
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册