MCPcopy
hub / github.com/apache/tvm / build_and_run

Function build_and_run

tests/python/relax/test_codegen_hipblas.py:49–56  ·  view source on GitHub ↗
(mod, inputs_np, target, legalize=False)

Source from the content-addressed store, hash-verified

47
48
49def build_and_run(mod, inputs_np, target, legalize=False):
50 dev = tvm.device(target, 0)
51 with tvm.transform.PassContext(config={"relax.transform.apply_legalize_ops": legalize}):
52 ex = tvm.compile(mod, target)
53 vm = relax.VirtualMachine(ex, dev)
54 f = vm["main"]
55 inputs = [tvm.runtime.tensor(inp, dev) for inp in inputs_np]
56 return f(*inputs).numpy()
57
58
59def get_result_with_relax_cublas_offload(mod, np_inputs):

Callers 2

test_matmul_offloadFunction · 0.70

Calls 4

numpyMethod · 0.80
fFunction · 0.70
deviceMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…