code: def test_armv7m_intrinsic(
      workspace_dir, board, microtvm_debug, serial_number
  ):
      """Testing a ARM v7m SIMD extension."""
      build_config = {"debug": microtvm_debug}
  
      this_dir = pathlib.Path(os.path.dirname(__file__))
      testdata_dir = this_dir.parent / "testdata" / "mnist"
  
      relay_mod, params = _open_tflite_model()
  
      sample, output_shape = _get_test_data(testdata_dir)
  
      relay_mod_simd = _apply_desired_layout_simd(relay_mod)
      # kernel layout "HWIO" is not supported by arm_cpu SIMD extension (see tvm\python\relay\op\strategy\arm_cpu.py)
      relay_mod_no_simd = _apply_desired_layout_no_simd(relay_mod)
  
      target = tvm.target.target.micro(
          utils.ZEPHYR_BOARDS[board]["model"], options=["-keys=cpu"]
      )
      target_simd = tvm.target.target.micro(
          utils.ZEPHYR_BOARDS[board]["model"],
          options=["-keys=arm_cpu,cpu"],
      )
  
      executor = Executor(
          "aot", {"unpacked-api": True, "interface-api": "c"}
      )
      runtime = Runtime("crt")
  
      workspace_dir_simd = workspace_dir / "simd"
      workspace_dir_no_simd = workspace_dir / "nosimd"
  
      os.makedirs(workspace_dir_simd, exist_ok=True)
      os.makedirs(workspace_dir_no_simd, exist_ok=True)
  
      with tvm.transform.PassContext(
          opt_level=3, config={"tir.disable_vectorize": True}
      ):
          lowered_simd = relay.build(
              relay_mod_simd,
              target_simd,
              params=params,
              runtime=runtime,
              executor=executor,
          )
          lowered_no_simd = relay.build(
              relay_mod_no_simd,
              target,
              params=params,
              runtime=runtime,
              executor=executor,
          )
  
          simd_project, _ = utils.generate_project(
              workspace_dir_simd,
              board,
              lowered_simd,
              build_config,
              sample,
              output_shape,
              "float32",
              True,
              serial_number,
          )
          result_simd, time_simd = utils.run_model(simd_project)
  
          no_simd_project, _ = utils.generate_project(
              workspace_dir_no_simd,
              board,
              lowered_no_simd,
              build_config,
              sample,
              output_shape,
              "float32",
              False,
              serial_number,
          )
          result_no_simd, time_no_simd = utils.run_model(
              no_simd_project
          )
  
      assert result_no_simd == result_simd == 2
  
      # Time performance measurements on QEMU emulator are always equal to zero.
      if board not in [
          "mps2_an521",
          "mps3_an547",
      ]:
          assert time_no_simd > time_simd
  
file_path: tvm/tests/micro/zephyr/test_zephyr_armv7m.py
imports: import os
  import pathlib
  import pytest
  import numpy
  import tvm
  import tvm.rpc
  import tvm.micro
  import tvm.testing
  from tvm import relay
  from tvm.contrib.download import download_testdata
  from tvm.relay.backend import Executor, Runtime
  from .None import utils
label_desc: Use image node_id 5 for calling a global function with example usage: test_armv7m_intrinsic(workspace_dir, board, microtvm_debug, serial_number) without return types