[Dy2St][AMP] Support local enable the auto_cast
#58977
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
New features
PR changes
Others
Description
在 #58628 基础上进行修改,支持了「局部开」的 AMP 策略
将 Operator 上的
should_auto_cast: bool
修改为拥有更多信息的amp_options: AmpOptions
,原来的op.should_auto_cast
可通过op.amp_options.enable
来访问,同样,prepare_op_should_auto_cast
也 rename 为prepare_op_amp_options
因为原来假定了全局一定是启用 AMP 的,但对于「局部开」来说,全局应该是关的,因此在
prepare_op_amp_options
时需要额外传入全局的状态,可参考新增单测test_should_auto_cast_3
即为「全局关局部开」的示例PCard-66972