code: def intrin_multi_channel_convolve(
      in_dtype,
      _tensor_h,
      tensor_w,
      channels,
      kernel_h,
      kernel_w,
      suffix,
  ):
      """Defines a v7e-m DSP-accelerated multi-channel convolution. Works on two
      channels if in_dtype==int16, and four channels if in_dtype==int8.
      """
      simd_lanes = num_simd_lanes_per_word(in_dtype)
  
      overlap_dims = (kernel_h, kernel_w, simd_lanes)
      data_slice = te.placeholder(
          overlap_dims, name="data_slice", dtype=in_dtype
      )
      kernel_slice = te.placeholder(
          overlap_dims, name="kernel_slice", dtype=in_dtype
      )
  
      kh_i = te.reduce_axis((0, kernel_h), name="kh_i")
      kw_i = te.reduce_axis((0, kernel_w), name="kw_i")
  
      output_slice = te.compute(
          (simd_lanes,),
          lambda k: te.sum(
              data_slice[kh_i, kw_i, k].astype("int32")
              * kernel_slice[kh_i, kw_i, k].astype("int32"),
              axis=(kh_i, kw_i),
          ),
          name="c",
      )
  
      data_buf = tir.decl_buffer(
          data_slice.shape,
          data_slice.dtype,
          name="data",
          offset_factor=1,
          strides=[tensor_w * channels, channels, 1],
      )
      kernel_buf = tir.decl_buffer(
          kernel_slice.shape,
          kernel_slice.dtype,
          name="kernel",
          offset_factor=1,
          strides=[kernel_w * simd_lanes, simd_lanes, 1],
      )
      output_buf = tir.decl_buffer(
          output_slice.shape,
          output_slice.dtype,
          name="output",
          offset_factor=1,
          strides=[1],
      )
  
      def intrin_func(ins, outs):
          builder = tir.ir_builder.create()
          builder.emit(
              tir.call_extern(
                  "int32",
                  _get_func_name(
                      in_dtype,
                      tensor_w,
                      channels,
                      kernel_h,
                      kernel_w,
                      suffix,
                  ),
                  outs[0].access_ptr("w"),
                  ins[0].access_ptr("r"),
                  ins[1].access_ptr("r"),
              )
          )
          return builder.get()
  
      return te.decl_tensor_intrin(
          output_slice.op,
          intrin_func,
          binds={
              data_slice: data_buf,
              kernel_slice: kernel_buf,
              output_slice: output_buf,
          },
      )
  
file_path: tvm/python/tvm/topi/arm_cpu/mprofile/dsp/micro_kernel/multi_channel_convolve.py
imports: import textwrap
  from tvm import te, tir
  from .common import num_simd_lanes_per_word, common_includes
label_desc: Use image node_id 2 for calling a global function with example usage: intrin_multi_channel_convolve(in_dtype, _tensor_h, tensor_w, channels, kernel_h, kernel_w, suffix) and returns: te, builder