From 02888e52e20792738365227c5184d32b0c088d66 Mon Sep 17 00:00:00 2001 From: Yuan Shuai Date: Tue, 29 Oct 2019 22:23:59 +0800 Subject: [PATCH] Fix target bug: kHost and kARM not equal. test=develop (#2273) * Fix bug target for kHost and kARM not equal. test=develop * Fix license. test=develop --- lite/core/mir/type_target_cast_pass.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lite/core/mir/type_target_cast_pass.cc b/lite/core/mir/type_target_cast_pass.cc index be246d7026..7a32777865 100644 --- a/lite/core/mir/type_target_cast_pass.cc +++ b/lite/core/mir/type_target_cast_pass.cc @@ -125,7 +125,8 @@ void TypeTargetTransformPass::AddIoCopyInst( VLOG(4) << "------ kernel info -------"; VLOG(4) << "*in_arg_ty(io_copy kernel input):" << *in_arg_ty; VLOG(4) << "from(last kernel output):" << from; - VLOG(4) << "to:" << to; + VLOG(4) << "out_arg_ty(io_copy kernel output):" << *out_arg_ty; + VLOG(4) << "to:" << to << "\n"; // kernel choose branch for opencl backend // judge inst's target whether is kOpenCL @@ -143,7 +144,7 @@ void TypeTargetTransformPass::AddIoCopyInst( if (TargetCompatibleTo(*in_arg_ty, from) && PrecisionCompatibleTo(*in_arg_ty, from) && DeviceCompatibleTo(*in_arg_ty, from) && - out_arg_ty->target() == to.target()) { + TargetCompatibleTo(*out_arg_ty, to)) { VLOG(4) << "do nothing. opencl found"; #else if (TypeCompatible(*in_arg_ty, from) && -- GitLab