[Framework] Add method for specifying initial size of workspace_
#4402
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.
cherry-picked from #4378
【背景】
DeviceInfo
会申请L3Cache
尺寸的workspace_
,供算子中汇编使用。L3 cache
与手机型号有关,在mate20手机上可达4M,但相应大小的workspace_
在小模型上不能全部被应用,造成内存浪费。【本PR修改】
新增接口
MobileConfig::SetArmL3CacheSize
:补充四种设置workspace_
初始大小的方法【使用示例】
workspace_
设置为L3_Cache
的大小(默认行为)// 不需要修改
workspace_
设置为L2_Cache
的大小设置绝对值(以1M为例)