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

Function check_rocm

tests/python/codegen/test_target_codegen_rocm.py:65–71  ·  view source on GitHub ↗
(dtype, n)

Source from the content-addressed store, hash-verified

63@pytest.mark.skipif(not env.has_rocm(), reason="need rocm")
64def test_rocm_copy():
65 def check_rocm(dtype, n):
66 dev = tvm.rocm(0)
67 a_np = np.random.uniform(size=(n,)).astype(dtype)
68 a = tvm.runtime.empty((n,), dtype, dev).copyfrom(a_np)
69 b_np = a.numpy()
70 tvm.testing.assert_allclose(a_np, b_np)
71 tvm.testing.assert_allclose(a_np, a.numpy())
72
73 for _ in range(100):
74 dtype = np.random.choice(["float32", "float16", "int8", "int32"])

Callers 2

test_rocm_copyFunction · 0.85
test_rocm_vectorize_addFunction · 0.85

Calls 7

rocmMethod · 0.80
uniformMethod · 0.80
copyfromMethod · 0.80
numpyMethod · 0.80
astypeMethod · 0.45
emptyMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…