ashutosh-arm commented on a change in pull request #9331: URL: https://github.com/apache/tvm/pull/9331#discussion_r733874882
########## File path: src/relay/backend/contrib/cmsisnn/relay_to_tir.cc ########## @@ -43,23 +44,153 @@ class RelayToTIRVisitor : public MixedModeVisitor { inline IntImm ToArg(int32_t value) { return IntImm(DataType::Int(32), value); } void CreatePrimFuncForExtern(Array<tir::Var> func_signature, - tvm::Array<PrimExpr> call_extern_args) { + tvm::Array<PrimExpr> call_extern_args, int context_buffer_size = 0) { Map<String, ObjectRef> dict_attrs; dict_attrs.Set("global_symbol", func_name_); dict_attrs.Set("tir.noalias", Bool(true)); tir::Stmt body = tir::Evaluate( tvm::tir::Call(DataType::Int(8), tir::builtin::call_extern(), call_extern_args)); + if (context_buffer_size) { + // TODO(@ashutosh-arm) while supporting MVE, we need to move allocation through TVMBAW + tir::Var buffer_var("context_buffer", PointerType(PrimType(DataType::Int(8)), "global")); + body = tir::Allocate(buffer_var, DataType::Int(8), {context_buffer_size}, tir::const_true(), + body); + } + primfunc_ = tir::PrimFunc(func_signature, body, VoidType(), Map<tir::Var, tir::Buffer>(), DictAttrs(dict_attrs)); } + void EmitConv2D(const Expr& expr) { + const CallNode* clip_call = nullptr; + const CallNode* requantize_call = nullptr; + const CallNode* bias_add_call = nullptr; + const CallNode* conv2d_call = nullptr; + auto* final_call = expr.as<CallNode>(); + auto* final_op = final_call->op.as<OpNode>(); Review comment: ACK -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org