MCPcopy Index your code
hub / github.com/apache/tvm / main

Method main

tests/python/relax/test_transform_lower_gpu_ipc_alloc_storage.py:44–56  ·  view source on GitHub ↗
(shape: R.Shape(["m", "n"]))

Source from the content-addressed store, hash-verified

42 class Expected:
43 @R.function(pure=False)
44 def main(shape: R.Shape(["m", "n"])): # type: ignore
45 m = T.int64()
46 n = T.int64()
47 storage: R.Object = R.call_packed(
48 "runtime.disco.cuda_ipc.alloc_storage",
49 R.shape([m, n]),
50 R.dtype("float16"),
51 sinfo_args=(R.Object,),
52 )
53 alloc: R.Tensor((m, n), dtype="float16") = R.memory.alloc_tensor( # type: ignore
54 storage, R.prim_value(0), R.shape([m, n]), R.dtype("float16")
55 )
56 return alloc
57
58 mod = relax.transform.LowerGPUIPCAllocStorage()(Module)
59 tvm.ir.assert_structural_equal(mod, Expected)

Callers

nothing calls this directly

Calls 5

ShapeMethod · 0.80
call_packedMethod · 0.80
TensorMethod · 0.80
shapeMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected