From 5e40951f61f4f24d9aa1cc0fbcd615e703a30f6f Mon Sep 17 00:00:00 2001 From: Wuwei Lin Date: Tue, 21 Feb 2023 14:53:18 -0800 Subject: [PATCH] [Codegen][CUDA] Add error message for missing fragment info --- src/target/source/codegen_cuda.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/target/source/codegen_cuda.cc b/src/target/source/codegen_cuda.cc index 20607254370e..077c70af2f1b 100644 --- a/src/target/source/codegen_cuda.cc +++ b/src/target/source/codegen_cuda.cc @@ -1272,6 +1272,8 @@ void CodeGenCUDA::PrintWmmaScope(const std::string& scope, DataType t, const Var std::ostream& os) { std::stringstream type; PrintType(t, type); + ICHECK(fragment_shapes.count(variable)) + << "Cannot find shape of the wmma fragment " << variable->name_hint; std::string shape_str = fragment_shapes.at(variable); if ((t.is_int() || t.is_uint()) && t.bits() < 8 && t.lanes() == 1) { type.str(std::string()); @@ -1321,6 +1323,8 @@ int stoi(const std::string& str) { int32_t CodeGenCUDA::GetWmmaFragmentSize(const std::string& scope, const VarNode* variable, int32_t size) { + ICHECK(fragment_shapes.count(variable)) + << "Cannot find shape of the wmma fragment " << variable->name_hint; std::string shape_str = fragment_shapes.at(variable); size_t m, n, k; size_t last_pos = 0, pos = 0;