code: def test_gemm_tensorcore():
      """Test running gemm on tensorcore."""
      dev = tvm.device("cuda", 0)
      a_np = np.random.uniform(size=(1024, 1024)).astype("float16")
      b_np = np.random.uniform(size=(1024, 1024)).astype("float16")
      c_np = np.dot(a_np.astype("float32"), b_np.T.astype("float32"))
      buff_a = tvm.nd.array(a_np, dev)
      buff_b = tvm.nd.array(b_np, dev)
      buff_c = tvm.nd.array(
          np.zeros((1024, 1024), dtype="float32"), dev
      )
      myfunc = tvm.build(tensorcore_gemm, target="cuda", name="dense")
      myfunc(buff_a, buff_b, buff_c)
      tvm.testing.assert_allclose(buff_c.numpy(), c_np, rtol=1e-3)
  
      evaluator = myfunc.time_evaluator(
          myfunc.entry_name, dev, number=100
      )
      time_elapsed = evaluator(buff_a, buff_b, buff_c).mean
      num_flops = 2 * 1024 * 1024 * 1024
      gflops = num_flops / (time_elapsed * 1e3) / 1e6
      print("gemm with tensor core: %f ms" % (time_elapsed * 1e3))
      print("GFLOPS: %f" % gflops)
  
imports: import numpy
  import tvm
  import tvm.testing
  from tvm.script import tir
label_desc: Use image node_id 2 for calling a global function with example usage: test_gemm_tensorcore() without return types