def reconstruct_target_args(args): """Reconstructs the target options from the arguments""" target_kinds = Target.list_kinds() reconstructed = {} for target_kind in target_kinds: target = Target(target_kind) kind_options = _reconstruct_target_kind_args(args, target.kind) if kind_options: reconstructed[target.kind.name] = kind_options return reconstructed
def generate_target_args(parser): """Walks through the TargetKind registry and generates arguments for each Target's options""" parser.add_argument( "--target", help= "compilation target as plain string, inline JSON or path to a JSON file", required=True, ) target_kinds = Target.list_kinds() for target_kind in target_kinds: target = Target(target_kind) _generate_target_kind_args(parser, target.kind)
def enabled(): return "cmsis-nn" in Target.list_kinds()
def _valid_target_kinds(): codegen_names = tvmc.composite_target.get_codegen_names() return filter(lambda target: target not in codegen_names, Target.list_kinds())