code: def test_dyn_shared_vectorized_store():
      """Test vectorized store into dynamic shared memory"""
      n = te.size_var("n")
      A = te.placeholder((n,), name="A", dtype="float16")
      B = te.placeholder((n,), name="B", dtype="float32")
  
      def test_device_ir(A, B, C):
          n = A.shape[0]
          ib = tvm.tir.ir_builder.create()
  
          values_per_thread = 4
          tx = te.thread_axis("threadIdx.x")
          ib.scope_attr(
              tx,
              "thread_extent",
              tvm.tir.indexdiv(n, values_per_thread),
          )
  
          A_sh = ib.allocate(A.dtype, (n,), scope="shared.dyn")  # fp16
          B_sh = ib.allocate(B.dtype, (n,), scope="shared.dyn")  # fp32
  
          Aptr = ib.buffer_ptr(A)
          Bptr = ib.buffer_ptr(B)
          Cptr = ib.buffer_ptr(C)
  
          with ib.for_range(
              0, values_per_thread, kind="vectorize"
          ) as i:
              A_sh[tx * values_per_thread + i] = Aptr[
                  tx * values_per_thread + i
              ]
              B_sh[tx * values_per_thread + i] = Bptr[
                  tx * values_per_thread + i
              ]
  
          with ib.for_range(0, values_per_thread) as i:
              Cptr[tx * values_per_thread + i] = (
                  cast(A_sh[tx * values_per_thread + i], "float32")
                  + B_sh[tx * values_per_thread + i]
              )
  
          return ib.get()
  
      C = te.extern(
          (n,),
          [A, B],
          lambda ins, outs: test_device_ir(ins[0], ins[1], outs[0]),
          name="vadd",
          dtype="float32",
      )
      s = te.create_schedule(C.op)
  
      mod = run_passes(s, [A, B, C])
      verify_single_allocation(mod["main"].body)
  
      def check_target(target):
          if not tvm.testing.device_enabled(target):
              return
  
          fadd = tvm.build(s, [A, B, C], target)
          dev = tvm.device(target, 0)
  
          for n in [512, 1024]:
              a = tvm.nd.array(
                  np.random.uniform(size=n).astype(A.dtype), dev
              )
              b = tvm.nd.array(
                  np.random.uniform(size=n).astype(B.dtype), dev
              )
              c = tvm.nd.array(np.zeros((n,), dtype=C.dtype), dev)
              fadd(a, b, c)
              tvm.testing.assert_allclose(
                  c.numpy(),
                  a.numpy().astype("float32") + b.numpy(),
                  1e-4,
                  1e-4,
              )
  
      for target in ["cuda", "nvptx"]:
          check_target(target)
  
imports: import numpy
  import tvm
  import tvm.testing
  from tvm import te
  from tvm.driver.build_module import schedule_to_module
  from tvm.topi.math import cast
  from tvm.script import tir
label_desc: Use image node_id 4 for calling a global function with example usage: test_dyn_shared_vectorized_store() and returns: ib