code: def intrin_gemv(m, l):
      a = te.placeholder((l,), name="a")
      b = te.placeholder((m, l), name="b")
      k = te.reduce_axis((0, l), name="k")
      c = te.compute(
          (m,), lambda i: te.sum(a[k] * b[i, k], axis=k), name="c"
      )
      Ab = tvm.tir.decl_buffer(
          a.shape, a.dtype, name="A", offset_factor=1, strides=[1]
      )
      Bb = tvm.tir.decl_buffer(
          b.shape,
          b.dtype,
          name="B",
          offset_factor=1,
          strides=[te.var("s1"), 1],
      )
      Cb = tvm.tir.decl_buffer(
          c.shape, c.dtype, name="C", offset_factor=1, strides=[1]
      )
  
      def intrin_func(ins, outs):
          aa, bb = ins
          cc = outs[0]
  
          def _body():
              ib = tvm.tir.ir_builder.create()
              ib.emit(
                  tvm.tir.call_extern(
                      "int32",
                      "gemv_update",
                      cc.access_ptr("w"),
                      aa.access_ptr("r"),
                      bb.access_ptr("r"),
                      m,
                      l,
                      bb.strides[0],
                  )
              )
              return ib.get()
  
          def _reduce_reset():
              ib = tvm.tir.ir_builder.create()
              ib.emit(
                  tvm.tir.call_extern(
                      "int32", "gemv_reset", cc.access_ptr("w"), m
                  )
              )
              return ib.get()
  
          def _reduce_update():
              return _body()
  
          return _body(), _reduce_reset(), _reduce_update()
  
      return te.decl_tensor_intrin(
          c.op, intrin_func, binds={a: Ab, b: Bb, c: Cb}
      )
  
file_path: tvm/gallery/how_to/work_with_schedules/tensorize.py
imports: from __future__ import absolute_import, print_function
  import tvm
  from tvm import te
  import tvm.testing
  import numpy
  from tvm.topi.utils import get_const_tuple
label_desc: Use image node_id 4 for calling a global function with example usage: intrin_gemv(m, l) and returns: te, _body,  _reduce_reset,  _reduce_update, ib, ib, _body