CANN/opbase DFX诊断接口文档
op_dfx【免费下载链接】opbase本项目是CANN算子库的基础框架库为算子提供公共依赖文件和基础调度能力。项目地址: https://gitcode.com/cann/opbase本章接口为预留接口后续有可能变更或废弃不建议开发者使用开发者无需关注。表 1接口列表接口定义功能说明ToString(const std::string str)将std::string转换为ge::AscendString。OpDfxGuard(const charfile, int line, OpLevel level, const charfuncName, const charparamNamesIn, const charparamNamesOut, const INPUT_TUPLE in, const OUTPUT_TUPLE out)DFX统计guard的构造函数。OpDfxGuard(const charfile, int line, OpLevel level, const charfuncName)DFX统计guard的构造函数。OpDfxGuard(uint32_t id, const charfile, int line, OpLevel level, const charfuncName, const char *paramNames, const std::tupleArgs... t)DFX统计guard的构造函数。OpDfxGuard(uint64_t id, DfxProfilingType type)DFX统计guard的构造函数。OpDfxGuard()DFX统计guard的构造函数。ValidDfxName([[maybe_unused]]char consta, [[maybe_unused]]char constb)判断a bOpGetLogSequence()获取日志序号。GenSummaryItemId(const charl2Name, const charl0Name)用L2和L0的接口名生成一个唯一的统计id。GenSummaryItemId(const charl2Name, const charl0Name, const char *opType)用L2和L0的接口名以及算子类型名生成一个唯一的统计id。GenKernelLauncherId(const char *l0Name)用L0接口名生成kernel launch的统计id。OpProfilingSwitch()OpProfilingSwitch构造函数。OpLogInfo()OpLogInfo构造函数。OpLogInfo(const OpLogInfo rhs)OpLogInfo拷贝构造函数。InitLevelZero()初始化L0统计信息。InitLevelTwo()初始化L2统计信息。PtrCastTo(From *ptr)将ptr转换为指定类型的指针。PtrCastTo(const From *ptr)将ptr转换为指定类型的指针。GenOpTypeId(const char *opName)以给定的算子名生成唯一的算子id。IsDumpEnabled()判断是否使能dump。InitThreadLocalContext()初始化线程局部上下文信息。AddInputTensorToThreadLocalCtx(const aclTensor *const t)线程局部上下文信息中增加input tensor信息。AddInputTensorToThreadLocalCtx(aclTensor *const t)线程局部上下文信息中增加input tensor信息。AddInputTensorToThreadLocalCtx([[maybe_unused]] T t)线程局部上下文信息中增加input tensor信息。AddInputTensorsToThreadLocalCtx(const std::tupleArgs... t)线程局部上下文信息中增加多个input tensor信息。AddInputTensorToThreadLocalCtx(const aclTensorList *const t)线程局部上下文信息中增加多个input tensor信息。AddInputTensorToThreadLocalCtx(aclTensorList *const t)线程局部上下文信息中增加多个input tensor信息。AddOutputTensorToThreadLocalCtx(const aclTensor *const t)线程局部上下文信息中增加output tensor信息。AddOutputTensorToThreadLocalCtx(aclTensor *const t)线程局部上下文信息中增加output tensor信息。AddOutputTensorToThreadLocalCtx([[maybe_unused]] T t)线程局部上下文信息中增加output tensor信息。AddOutputTensorsToThreadLocalCtx(const std::tupleArgs... t)线程局部上下文信息中增加多个output tensor信息。AddOutputTensorToThreadLocalCtx(const aclTensorList *const t)线程局部上下文信息中增加多个output tensor信息。AddOutputTensorToThreadLocalCtx(aclTensorList *const t)线程局部上下文信息中增加多个output tensor信息。CreateDfxProfiler(const char *funcName)用给定funcName创建统计器。CreateDfxProfiler(uint32_t id)用给定id创建统计器。ToStr(const T t, std::string res, std::vectorstd::string v, size_t index)将给定的参数转换为字符串。StringToVec(const char *paramNames, std::vectorstd::string v)将给定字符串按逗号分隔。StringToVecWithBrackets(const char *paramNames, std::vectorstd::string v)提取形如DFX_IN(aa, bb, cc)或DFX_OUT(aa, bb)字符串的子项。SplitStringAndPrint(std::string res)将给定长字符串分为多个子字符串打印。BuildParamString(const char *paramNames, const std::tupleArgs... t)用给定的算子入参生成参数字符串。BuildParamStringWithBrackets(const char *paramNames, const std::tupleArgs... t)用给定的算子入参生成参数字符串。GenOpTypeId(const char *opName, const OP_RESOURCES opResources)用给定的算子名和二进制资源生成唯一的算子id。GenOpTypeId(const char *opName, const OP_SOC_RESOURCES opResources)用给定的算子名和SOC二进制资源生成唯一的算子id。GenInternalOpTypeId()生成内部算子id。aclnnStatus CheckPhase1Params(aclOpExecutor **executor, uint64_t *workspaceSize)校验一阶段中公共入参是否为nullptr。【免费下载链接】opbase本项目是CANN算子库的基础框架库为算子提供公共依赖文件和基础调度能力。项目地址: https://gitcode.com/cann/opbase创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考