code: def _validate_opencl_executors(executor_type, get_model, ref_impl):
      from tvm.contrib import graph_executor
      from tvm.runtime.vm import VirtualMachine
  
      input_dict, model = get_model()
      if executor_type == "ge":
          with tvm.transform.PassContext(opt_level=3):
              lib = relay.build(
                  model, target_host="llvm", target=target
              )
          ocl_lib = lib.get_lib()
      else:
          module = tvm.IRModule({})
          module["main"] = model
          with tvm.transform.PassContext(opt_level=3):
              lib = relay.vm.compile(
                  module, target=target, target_host="llvm"
              )
          ocl_lib = lib.module.imported_modules[0]
      opencl_modules = list(
          filter(
              lambda mod: mod.type_key == "opencl",
              ocl_lib.imported_modules,
          )
      )
      assembly = opencl_modules[0].get_source()
      with tvm.target.Target(target):
          limit = tvm.target.Target.current().max_function_args
      max_num = _get_maximum_kernel_args(assembly)
      assert max_num <= limit
  
      dev = tvm.cl()
      if executor_type == "ge":
          module = graph_executor.GraphModule(lib["default"](dev))
          module.set_input(**input_dict)
          module.run()
          tvm_out = module.get_output(0)
      else:
          vm = VirtualMachine(lib, dev, "naive")
          data = {}
          for k, v in input_dict.items():
              data[k] = tvm.nd.array(v, dev)
          vm.set_input("main", **data)
          vm.invoke_stateful("main")
          tvm_out = vm.get_outputs()[0]
  
      np_result = ref_impl(list(input_dict.values()))
      np.testing.assert_allclose(
          tvm_out.asnumpy(), np_result, rtol=1e-2, atol=1e-2
      )
  
file_path: tvm/tests/python/codegen/test_target_codegen_opencl.py
imports: import tvm
  from tvm import te, relay
  import tvm.testing
  import re
  import pytest
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: _validate_opencl_executors(executor_type, get_model, ref_impl) without return types