tvm_tirx.testing

tvm_tirx.testing#

TIRX test utilities and local capability probes.

Functions#

echo

Callable wrapper around a TVM FFI function.

object_use_count

Callable wrapper around a TVM FFI function.

test_raise_error

Callable wrapper around a TVM FFI function.

run_with_gpu_lock(func, /, *args, **kwargs)

Run a callable while holding the machine-local GPU lock.

assert_allclose(actual, desired[, rtol, ...])

Version of np.testing.assert_allclose with atol and rtol fields set in reasonable defaults.

device_enabled(target)

Return whether the target's runtime and local device are available.

identity_after(x, sleep)

Testing function to return identity after sleep

terminate_self()

Testing function to terminate the process.

main()

np_dtype_from_str(dtype)

Convert a string dtype to a numpy dtype.

generate_random_array(dtype, shape)

Generate a random array by generating random bits and casting to the target dtype.

Namespaces#