tqchen commented on a change in pull request #5484:
URL: https://github.com/apache/incubator-tvm/pull/5484#discussion_r419676108



##########
File path: python/tvm/contrib/cc.py
##########
@@ -90,7 +90,8 @@ def get_target_triple():
 def cross_compiler(compile_func,
                    options=None,
                    output_format=None,
-                   get_target_triple=None):
+                   get_target_triple=None,
+                   add_files=None):

Review comment:
       I think it is mainly a difference in API choices.
   
   - A0  pushing more flags to export_library 
   - A1 using functional style programming decorator, to decorate a existing 
compiler by adding ldflags implicitly. Pass in fcompile variants, or use 
fcompile->fcompile functors to decorate new compilers.
   
   My take is that A1 is as powerful as A0, and the complexity of compiler 
customization goes to the construction process of fcompile.  It also have the 
advantage of moving customization to a single place (fcompile) so that we don't 
have to worry about customizing the export_library step in autotvm and 
downstream toolchains that uses export_library.
   
   We can certainly de-couple the APIs in A1. Right now compilation and linking 
are coupled, and a more powerful way to construct A1 might be as follows, and 
we can work toward that direction. 
   ```python
   fcompile = attach_linker_opts(get_compiler())
   ```
   
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to