简介
ExeResGenerationContext继承自ExtendedKernelContext,用于生成执行资源的上下文类,主要用于在算子执行前,生成或配置执行所需的各种资源,包括:内存、异步执行流、同步资源、算子属性、输入输出张量的形状信息。
ExeResGenerationContext继承关系图如下:
需要包含的头文件
1 | #include "exe_graph/runtime/exe_res_generation_context.h" |
Public成员函数
ExecuteMode GetExecuteMode() const bool IsConstInput(const ge::AscendString &name) const const gert::StorageShape* GetInputShape(int64_t index) const const gert::StorageShape* GetOutputShape(int64_t index) const ge::graphStatus SetAttachedStreamInfos(std::vector<StreamInfo> &stream_info_vec) const std::vector<StreamInfo> GetAttachedStreamInfos() const int64_t GetStreamId() const ge::graphStatus SetSyncResInfos(std::vector<SyncResInfo> &sync_info_vec) const std::vector<SyncResInfo> GetSyncResInfos() const std::vector<int64_t> GetWorkspaceBytes() const void SetWorkspaceBytes(const std::vector<int64_t> &workspace_bytes) const int64_t GetOpId() const ge::graphStatus SetListStr(const std::string &attr_name, const std::vector<std::string> &list) const bool GetStrAttrVal(const char *attr_name, ge::AscendString &val) const bool SetStrAttrVal(const char *attr_name, const char *val) const bool GetIntAttrVal(const char *attr_name, int64_t &val) const bool SetIntAttrVal(const char *attr_name, const int64_t val) const