code: def test_parallel_alloc():
      ib = tvm.tir.ir_builder.create()
      n = te.var("n")
      with ib.for_range(0, n, name="i", kind="parallel") as i:
          with ib.for_range(0, 10, name="j") as j:
              A = ib.allocate("float32", n, name="A", scope="global")
              A[j] = A[j] + 2
  
      body = ib.get()
      mod = tvm.IRModule.from_expr(tvm.tir.PrimFunc([n], body))
      body = tvm.tir.transform.StorageRewrite()(mod)["main"]
  
      assert isinstance(body.body.body, tvm.tir.Allocate)
  
      ib = tvm.tir.ir_builder.create()
      n = te.var("n")
      with ib.for_range(0, n, name="t") as i:
          ib.scope_attr(
              tvm.tir.const(1, "int32"),
              "pragma_scope",
              tvm.tir.StringImm("parallel_launch_point"),
          )
          with ib.for_range(0, n, name="i", kind="parallel") as i:
              with ib.for_range(0, 10, name="j") as j:
                  A = ib.allocate(
                      "float32", n, name="A", scope="global"
                  )
                  A[j] = A[j] + 2
      body = ib.get()
  
      mod = tvm.IRModule.from_expr(tvm.tir.PrimFunc([n], body))
      body = tvm.tir.transform.StorageRewrite()(mod)["main"]
  
      assert isinstance(body.body.body.body.body, tvm.tir.Allocate)
  
imports: import sys
  import pytest
  import tvm
  import tvm.testing
  from tvm import te
  from tvm.driver.build_module import schedule_to_module
  from tvm.script import tir
label_desc: Use image node_id 10 for calling a global function with example usage: test_parallel_alloc() without return types