This is an automated email from the ASF dual-hosted git repository.

manupa pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 342fbea84e [CMSIS-NN] Fix typo in EmitPool2D (#11702)
342fbea84e is described below

commit 342fbea84e1f569a495a500bfeceb764d7aaf110
Author: Philipp van Kempen <[email protected]>
AuthorDate: Tue Jul 19 14:37:36 2022 +0200

    [CMSIS-NN] Fix typo in EmitPool2D (#11702)
    
    Co-authored-by: Philipp v. K <[email protected]>
---
 src/relay/backend/contrib/cmsisnn/relay_to_tir.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/relay/backend/contrib/cmsisnn/relay_to_tir.cc 
b/src/relay/backend/contrib/cmsisnn/relay_to_tir.cc
index d1d1d20d6e..b0a7416bcc 100644
--- a/src/relay/backend/contrib/cmsisnn/relay_to_tir.cc
+++ b/src/relay/backend/contrib/cmsisnn/relay_to_tir.cc
@@ -439,13 +439,15 @@ class RelayToTIRVisitor : public MixedModeMutator {
 
     int context_buffer_size = 0;
     PrimExpr context_buffer_var = tir::StringImm("NULL");
-    if (pool_name == "cmsisnn.qnn_avg_pool2d") {
+    if (pool_name == "cmsis-nn.qnn_avg_pool2d") {
       CMSISNNFlags flags = GetCompilerFlags(transform::PassContext::Current());
       int32_t input_c = qnn::get_const_int(input_shape[3]);
       context_buffer_size = AvgPoolBufferSize(flags, input_c);
-      std::string context_buffer_name = "context_buffer_" + 
std::to_string(context_buffer_id_++);
-      context_buffer_var = tir::Var(context_buffer_name,
-                                    PointerType(PrimType(DataType::Int(8)), 
"global.workspace"));
+      if (context_buffer_size) {
+        std::string context_buffer_name = "context_buffer_" + 
std::to_string(context_buffer_id_++);
+        context_buffer_var = tir::Var(context_buffer_name,
+                                      PointerType(PrimType(DataType::Int(8)), 
"global.workspace"));
+      }
     }
     tvm::Array<PrimExpr> context_buffer_args = {context_buffer_var, 
ToArg(context_buffer_size)};
 

Reply via email to