code: def intrin_max(shape, in_dtype, out_dtype):
      """Defines a v7e-m DSP-accelerated max pool."""
      UNIQ_ID_LEN = 8
      uniq_id = "".join(
          random.choices(string.ascii_uppercase, k=UNIQ_ID_LEN)
      )
      func_prefix = "max8"
  
      assert in_dtype == "int8"
      assert out_dtype == "int8"
  
      x = te.placeholder(shape, name="x", dtype=in_dtype)
      k = te.reduce_axis((0, 1), name="rc")
      z = te.compute(
          shape,
          lambda *i: tvm.tir.max(x[i], axis=[k]).astype(out_dtype),
      )
  
      def _intrin_func(ins, outs):
          aa = ins[0]
          cc = outs[0]
  
          def _body():
              ib = tvm.tir.ir_builder.create()
              ib.emit(
                  tvm.tir.call_extern(
                      "int32",
                      f"{func_prefix}_{uniq_id}",
                      aa.access_ptr("r"),
                      cc.access_ptr("w"),
                      cc.strides[0],
                  )
              )
              return ib.get()
  
          def _reduce_reset():
              ib = tvm.tir.ir_builder.create()
              ib.emit(
                  tvm.tir.call_extern(
                      "int32",
                      f"{func_prefix}_reset_{uniq_id}",
                      cc.access_ptr("w"),
                      cc.strides[0],
                  )
              )
              return ib.get()
  
          def _reduce_update():
              return _body()
  
          return _body(), _reduce_reset(), _reduce_update()
  
      binds = {
          t: tvm.tir.decl_buffer(
              t.shape,
              t.dtype,
              t.op.name,
              strides=[
                  te.var(f"{t.op.name}_s_{i}")
                  for i in range(0, len(t.shape))
              ],
              offset_factor=1,
          )
          for t in [x, z]
      }
  
      intrin_decl = te.decl_tensor_intrin(
          z.op, _intrin_func, binds=binds
      )
      return intrin_decl, uniq_id
  
imports: import random
  import string
  import tvm
  from tvm import te
  from .None import common
label_desc: Use image node_id 1 for calling a global function with example usage: intrin_max(shape, in_dtype, out_dtype) and returns: intrin_decl,  uniq_id, _body,  _reduce_reset,  _reduce_update, ib, ib, _body