gromero commented on a change in pull request #9229:
URL: https://github.com/apache/tvm/pull/9229#discussion_r735792710
##########
File path: python/tvm/driver/tvmc/common.py
##########
@@ -520,3 +522,84 @@ def parse_configs(input_configs):
pass_context_configs[name] = parsed_value
return pass_context_configs
+
+
+def get_project_options(project_info):
+ options = project_info["project_options"]
+
+ options_by_method = defaultdict(list)
+ for opt in options:
+ # Get list of methods associated with an option based on the
+ # existance of a 'required' or 'optional' lists. API specification
+ # guarantees at least one of these lists will exist. If a list does
+ # not exist it's returned as None by the API.
+ metadata = ["required", "optional"]
+ om = [(opt[md], True if md == "required" else False) for md in
metadata if opt[md]]
+ for methods, is_opt_required in om:
+ for method in methods:
+ name = opt["name"]
+
+ if opt["type"] == "bool":
+ # TODO(gromero): Use only choices= and merge with non-bool
options below
+ option_choices_text = f"{name}={{true, false}}"
+
+ else:
+ if opt["choices"]:
+ choices = "{" + ", ".join(opt["choices"]) + "}"
+ else:
+ choices = opt["name"].upper()
+
+ option_choices_text = f"{name}={choices}"
+
+ help_text = opt["help"][0].lower() + opt["help"][1:]
+ formatted_help_text = format_option(option_choices_text,
help_text, is_opt_required)
+
+ option = {
+ "name": opt["name"],
+ "choices": opt["choices"],
+ "help_text": formatted_help_text,
+ "required": is_opt_required,
+ }
+ options_by_method[method].append(option)
+
+ return options_by_method
+
+
+def get_options(options):
Review comment:
@mehrdadh Fixed ZEPHYR_BASE as you suggested in
https://github.com/apache/tvm/pull/9229/commits/efbc2803a2f5c4775a4d6c0019e3ce0d3e262718#diff-e9070632c64e33062450a5c887a7a6b683d7294064584407aeff7aef24031dc1R280
--
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]