forked from mindspore-Ecosystem/mindspore
!10901 Add compile profiling for PyNative mode.
From: @zh_qh Reviewed-by: @ginfung,@zhunaipan Signed-off-by: @zhunaipan
This commit is contained in:
commit
61869a6602
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue