ONE - On-device Neural Engine
Loading...
Searching...
No Matches
codegen Namespace Reference

Functions

 command_schema ()
 

Function Documentation

◆ command_schema()

codegen.command_schema ( )

Definition at line 44 of file codegen.py.

44def command_schema():
46
47 # 1) Driver binary name (positional). This MUST match your actual driver.
48 # Example: "dummy-compile", "triv-compile", etc.
49 parser.add_argument("{BACKEND_NAME}-compile", action=DriverName)
50
51 # 2) The selected target name, propagated by onecc automatically when
52 # [backend] target=... is present in the ini.
53 parser.add_argument("--target", action=TargetOption)
54
55 # 3) Regular options supported by your backend driver.
56 # - Optional form: starts with hyphen(s)
57 # - Positional form: no leading hyphen
58 parser.add_argument("--verbose", action=NormalOption, dtype=bool)
59
60 # Many ONE tools use *_path; you can support both "output" and "output_path".
61 parser.add_argument("--output", "--output_path", action=NormalOption)
62
63 # Input is typically positional. Support both "input" and "input_path" keys.
64 parser.add_argument("input", "input_path", action=NormalOption)
65
66 # Add more backend-specific knobs as needed. Examples:
67 # parser.add_argument("--opt-level", action=NormalOption, dtype=int)
68 # parser.add_argument("--emit-debug-info", action=NormalOption, dtype=bool)
69 # parser.add_argument("--arch", action=NormalOption) # if your backend distinguishes sub-arch
70
71 return parser