code: def test_all_targets_device_type_verify():
      """Consistency verification for all targets' device type"""
      all_targets = [
          tvm.target.Target(t) for t in tvm.target.Target.list_kinds()
      ]
  
      for tgt in all_targets:
          # skip targets with hooks or otherwise intended to be used with external codegen
          relay_to_tir = tgt.get_kind_attr("RelayToTIR")
          tir_to_runtime = tgt.get_kind_attr("TIRToRuntime")
          is_external_codegen = tgt.get_kind_attr("is_external_codegen")
          if (
              relay_to_tir is not None
              or tir_to_runtime is not None
              or is_external_codegen
          ):
              continue
  
          if (
              tgt.kind.name
              not in tvm._ffi.runtime_ctypes.Device.STR2MASK
          ):
              raise KeyError(
                  "Cannot find target kind: %s in Device.STR2MASK"
                  % tgt.kind.name
              )
  
          assert (
              tgt.get_target_device_type()
              == tvm._ffi.runtime_ctypes.Device.STR2MASK[tgt.kind.name]
          )
  
imports: import json
  import pytest
  import tvm
  import tvm.testing
  from tvm.target import Target, arm_cpu, bifrost, cuda, intel_graphics, mali, rocm, vta
label_desc: Use image node_id 5 for calling a global function with example usage: test_all_targets_device_type_verify() without return types