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

Function check_c

tests/python/runtime/test_runtime_module_load.py:143–152  ·  view source on GitHub ↗
(device)

Source from the content-addressed store, hash-verified

141 worker.recv()
142
143 def check_c(device):
144 dev = tvm.device(device, 0)
145 if not tvm.testing.device_enabled(device):
146 print(f"Skip because {device} is not enabled")
147 return
148 f = tvm.compile(sch.mod, target=tvm.target.Target(device, host="c"))
149 a = tvm.runtime.tensor(np.random.uniform(size=1024).astype(A.dtype), dev)
150 b = tvm.runtime.tensor(np.zeros(1024, dtype=A.dtype), dev)
151 f["main"](a, b)
152 np.testing.assert_equal(b.numpy(), a.numpy() + 1)
153
154 for device in ["cuda", "vulkan", "opencl", "metal"]:
155 check_device(device)

Callers 1

test_device_module_dumpFunction · 0.70

Calls 7

printFunction · 0.85
uniformMethod · 0.80
numpyMethod · 0.80
deviceMethod · 0.45
compileMethod · 0.45
astypeMethod · 0.45
zerosMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…