code: def test_subroutine_call_to_externally_visible_subroutine():
      """Externally-visible subroutines should use the PackedFunc API
  
      Because the subroutine may be called directly by a user, it must
      use the PackedFunc API.  Its signature should be updated to the
      PackedFunc signature, and call sites should be updated to use
      `T.tvm_call_cpacked`.
      """
  
      @I.ir_module
      class before:
          @T.prim_func
          def main(A: T.Buffer(1, "float32")):
              T.func_attr(
                  {
                      "global_symbol": "main",
                      "target": T.target("llvm", host="llvm"),
                  }
              )
              before.subroutine(A.data)
  
          @T.prim_func
          def subroutine(A_data: T.handle("float32")):
              T.func_attr(
                  {
                      "global_symbol": "subroutine",
                      "target": T.target("llvm", host="llvm"),
                  }
              )
              T.evaluate(A_data)
  
      after = tvm.tir.transform.MakePackedAPI()(before)
  
      main_compute_scope = _find_compute_scope(after["main"])
      assert main_compute_scope is not None
      subroutine_compute_scope = _find_compute_scope(
          after["subroutine"]
      )
      assert subroutine_compute_scope is not None
  
      subroutine_call_op = main_compute_scope.body.value.op
      assert (
          isinstance(subroutine_call_op, tvm.ir.Op)
          and subroutine_call_op.name == "tir.tvm_call_cpacked"
      ), (
          f"The main function's CallNode should be lowered to the builtin 'tir.tvm_call_cpacked', "
          f"but instead has an operation of type {subroutine_call_op}"
      )
  
file_path: tvm/tests/python/tir-transform/test_tir_transform_make_packed_api.py
imports: import pytest
  import tvm
  import tvm.testing
  from tvm import te, tir
  from tvm.script import tir, ir
  from tvm.driver.build_module import schedule_to_module
label_desc: Use image node_id 10 for calling a global function with example usage: test_subroutine_call_to_externally_visible_subroutine() without return types