Target Architecture Options
Description
The target architecture options specify the target platform for the current PTO program.
Different targets may differ in supported types, layout combinations, operation constraints, and generated results. Therefore, specify the target architecture explicitly during compilation.
Related Parameters
--pto-arch=a3|a5
The default value of this option is a3. If it is not explicitly specified, ptoas compiles with a3.
The target architecture is specified by the --pto-arch command-line option of ptoas. You do not need to declare the target device information again through module attributes in the module of the PTO program.
Default Recommendations
If a program explicitly targets a specific architecture, it is recommended to always specify --pto-arch explicitly to avoid inconsistent results caused by changes to the default value.
When to Adjust
You are advised to pay attention to this parameter in the following scenarios:
- The same
.ptofile needs to be verified for different targets. - An operation or type combination is available on one target but unavailable on another.
- You need to compare compilation results under different targets.
Observable Effects
After switching the target architecture, users may observe the following:
- Some programs pass on one target but report errors on another.
- The accepted range of certain layouts or type combinations differs.
- The generated results contain target-dependent differences.
Common Usage
ptoas input.pto --pto-arch=a3 -o output.cppptoas input.pto --pto-arch=a5 -o output.cppTroubleshooting
If the same input behaves inconsistently on different targets, troubleshoot in the following order:
- Confirm whether
--pto-archis set correctly. - Check whether the program uses target-related types, layouts, or operation combinations.
- Compare the compilation results and error messages under the two targets.