From a99d5af35ce40f10453f705b88200fced3a0033e Mon Sep 17 00:00:00 2001 From: Naoya Maruyama Date: Fri, 30 Aug 2024 12:04:44 -0700 Subject: [PATCH] fix --- .../analysis/sync_information.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/csrc/device_lower/analysis/sync_information.cpp b/csrc/device_lower/analysis/sync_information.cpp index 83d1fd5edd1..f4c7b1ed01b 100644 --- a/csrc/device_lower/analysis/sync_information.cpp +++ b/csrc/device_lower/analysis/sync_information.cpp @@ -689,16 +689,18 @@ SyncMap::SyncMap(Fusion* fusion) { } if (GpuLower::current()->hasIdModel()) { - const auto& id_model = GpuLower::current()->idModel(); - auto producer_loop_id = - indexing_utils::getLoopPromotion(p_id, id_model); - auto consumer_loop_id = - indexing_utils::getLoopPromotion(c_id, id_model); - const auto& indexing_traveral_graph = - id_model.idGraph(IdMappingMode::ALMOSTEXACT); - if (indexing_traveral_graph.disjointValSets().strictAreMapped( - producer_loop_id, consumer_loop_id)) { - continue; + if (producer_ptype == consumer_ptype) { + const auto& id_model = GpuLower::current()->idModel(); + auto producer_loop_id = + indexing_utils::getLoopPromotion(p_id, id_model); + auto consumer_loop_id = + indexing_utils::getLoopPromotion(c_id, id_model); + const auto& indexing_traveral_graph = + id_model.idGraph(IdMappingMode::ALMOSTEXACT); + if (indexing_traveral_graph.disjointValSets().strictAreMapped( + producer_loop_id, consumer_loop_id)) { + continue; + } } } else { if (producer_ptype == consumer_ptype &&