!10901 Add compile profiling for PyNative mode.

From: @zh_qh
Reviewed-by: @ginfung,@zhunaipan
Signed-off-by: @zhunaipan
This commit is contained in:
mindspore-ci-bot 2021-01-04 15:35:30 +08:00 committed by Gitee
commit 61869a6602
1 changed files with 8 additions and 1 deletions

View File

@ -315,7 +315,14 @@ bool GeOptimizeAction(const ResourcePtr &res) { return OptimizeAction(res, kGePa
bool VmOptimizeAction(const ResourcePtr &res) { return OptimizeAction(res, kVmPasses); }
bool PynativeOptimizeAction(const ResourcePtr &res) { return OptimizeAction(res, kPynativePasses); }
bool PynativeOptimizeAction(const ResourcePtr &resource) {
WITH(MsProfile::GetProfile())[&resource]() { (void)OptimizeAction(resource, kPynativePasses); };
#ifdef ENABLE_PROFILE
MsProfile::Print();
MsProfile::Reset();
#endif
return true;
}
bool PynativeElimOpt(const ResourcePtr &res) {
if (res->manager() == nullptr) {