leowang1225 commented on a change in pull request #7185:
URL: https://github.com/apache/tvm/pull/7185#discussion_r551207425
##########
File path: python/tvm/auto_scheduler/measure.py
##########
@@ -624,12 +652,10 @@ def local_build_worker(args):
The build result of this Builder thread.
"""
inp, build_func, timeout, verbose = args
- if build_func == "default":
- build_func = tar.tar
- elif build_func == "ndk":
- build_func = ndk.create_shared
- else:
- raise ValueError("Invalid build_func" + build_func)
+ assert build_func == BuildFunc.name, (
+ "BuildFunc.name: " + BuildFunc.name + ", but args is: " + build_func
+ )
+ build_func = BuildFunc.build_func
Review comment:
`
def cross_compiler(
compile_func, options=None, output_format=None, get_target_triple=None,
add_files=None
):
def _fcompile(outputs, objects, options=None):
all_options = base_options
if options is not None:
all_options += options
compile_func(outputs, objects + add_files, options=all_options,
**kwargs)
if not output_format and hasattr(compile_func, "output_format"):
output_format = compile_func.output_format
output_format = output_format if output_format else "so"
if not get_target_triple and hasattr(compile_func, "get_target_triple"):
get_target_triple = compile_func.get_target_triple
_fcompile.output_format = output_format
_fcompile.get_target_triple = get_target_triple
return _fcompile
`
----------------------------------------------------------------
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:
[email protected]