code: def test_rocm_cross_thread_reduction():
      # based on the reduction tutorial
      n = te.size_var("n")
      m = te.size_var("m")
      A = te.placeholder((n, m), name="A")
      k = te.reduce_axis((0, m), "k")
      B = te.compute((n,), lambda i: te.sum(A[i, k], axis=k), name="B")
      s = te.create_schedule(B.op)
      ko, ki = s[B].split(B.op.reduce_axis[0], factor=16)
      BF = s.rfactor(B, ki)
      xo, xi = s[B].split(s[B].op.axis[0], factor=32)
      s[B].bind(xo, bx)
      s[B].bind(xi, ty)
      s[B].bind(s[B].op.reduce_axis[0], tx)
      s[BF].compute_at(s[B], s[B].op.reduce_axis[0])
      s[B].set_store_predicate(tx.var.equal(0))
      frocm = tvm.build(s, [A, B], "rocm")
  
      nn = 128
      dev = tvm.rocm(0)
      a = tvm.nd.array(
          np.random.uniform(size=(nn, nn)).astype(A.dtype), dev
      )
      b = tvm.nd.array(np.zeros(nn, dtype=B.dtype), dev)
      frocm(a, b)
      tvm.testing.assert_allclose(
          b.numpy(), np.sum(a.numpy(), axis=1), rtol=1e-4
      )
  
file_path: tvm/tests/python/codegen/test_target_codegen_rocm.py
imports: import tvm
  import tvm.testing
  from tvm import te
  import numpy
  import unittest
  from tvm.script import tir
label_desc: Use image node_id 1 for calling a global function with example usage: test_rocm_cross_thread_reduction() without return types