def register_linker(): original_linker = tvm.contrib.hexagon.hexagon_link() # Register a phony linker, so that we can test codegen without a Hexagon toolchain. hexagon.register_linker(lambda: "/bin/true") yield None # Restore registration. hexagon.register_linker(original_linker)
def check_prereq_and_setup(): if tvm.target.codegen.llvm_version_major() <= 7: print("Skipping test: need LLVM 7 or later for codegen") return False if os.name != "posix": print("Skipping test on non-POSIX platforms") return False if not tvm.runtime.enabled("hexagon"): print("Hexagon runtime not enabled") return False # Register a phony linker, so that we can test codegen without a Hexagon toolchain. hexagon.register_linker(lambda: "/bin/true") return True