Created by: ysh329
状态:等待review、CI
优化Profile显示
优化点1:将之前的kernel相关的Layout、target等信息由之前的数字转为实际含义
先前的SerializedKernelType会调用如下函数:
std::string KernelBase::SerializeKernelType(const std::string &op_type,
const std::string &alias,
const Place &place) {
STL::stringstream ss;
ss << op_type << "/";
ss << alias << "/";
// We serialize the place value not the string representation here for
// easier deserialization.
ss << static_cast<int>(place.target) << "/";
ss << static_cast<int>(place.precision) << "/";
ss << static_cast<int>(place.layout);
return ss.str();
}
显示的内容会转为int,不适合大伙儿阅读,而summary转为对应的str,方便易于阅读:
std::string KernelBase::summary() const {
STL::stringstream ss;
ss << op_type() << ":" << TargetToStr(target()) << "/"
<< PrecisionToStr(precision()) << "/" << DataLayoutToStr(layout()) << "("
<< alias() << ")";
return ss.str();
}