kparzysz-quic commented on a change in pull request #8955:
URL: https://github.com/apache/tvm/pull/8955#discussion_r703956583



##########
File path: tests/python/unittest/test_target_codegen_hexagon.py
##########
@@ -26,8 +26,10 @@
 import tvm.contrib.hexagon as hexagon
 
 
-# Register a phony linker, so that we can test codegen without a Hexagon 
toolchain.
-hexagon.register_linker(lambda: "/bin/true")
[email protected](scope="session", autouse=True)
+def register_linker():
+    # Register a phony linker, so that we can test codegen without a Hexagon 
toolchain.
+    hexagon.register_linker(lambda: "/bin/true")

Review comment:
       This changes the global state of the TVM runtime (the registry), so I'm 
not sure how this is going to work if there are other tests running at the same 
time (that would want to set it to something else).  I'm not really 
anticipating adding runtime tests for Hexagon (only codegen) in the foreseeable 
future, so this "permanent" registration should work.
   
   The only reason the linker is needed is to create a shared library in 
`BuildHexagon`.  We can do all the preceding steps (incl. code generation into 
an object file) without any part of the Hexagon toolchain.  I think a better 
solution would be to see if we can delay the creation of the shared library 
until it needs to be saved.  This would eliminate the need for registering the 
linker altogether in codegen tests.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to