From 9e4f9df6a409396a8a4a20d967c4f51accf5d210 Mon Sep 17 00:00:00 2001 From: Masahiro Masuda Date: Sun, 10 Apr 2022 11:34:13 +0900 Subject: [PATCH] wrap tensorize with try/catch --- src/meta_schedule/postproc/rewrite_tensorize.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/meta_schedule/postproc/rewrite_tensorize.cc b/src/meta_schedule/postproc/rewrite_tensorize.cc index e54d43ff5bb5d..1735ceb10cf44 100644 --- a/src/meta_schedule/postproc/rewrite_tensorize.cc +++ b/src/meta_schedule/postproc/rewrite_tensorize.cc @@ -39,7 +39,11 @@ void ApplyTensorization(const tir::Schedule& sch, const String& func_name, std::string block_name = block_sref->StmtAs()->name_hint; if (block_name.find("init") == std::string::npos) { jobs.emplace_back(block_name, [sch, intrin_name](tir::BlockRV block) { - sch->Tensorize(block, intrin_name.value()); + try { + sch->Tensorize(block, intrin_name.value()); + } catch (const std::exception& e) { + LOG(WARNING) << "Tensorize failed with error " << e.what(); + } }); } else if (vectorize_init_loop) { jobs.emplace_back(block_name, [sch](tir::BlockRV block) {