aclrtcGetLoweredName
产 品 支 持 情 况
功 能 说 明
获 取 已 经 注 册 的__global__函 数 的mangling name。
函 数 原 型
Text
aclError aclrtcGetLoweredName(aclrtcProg prog, const char *nameExpression, const char **loweredName)
参 数 说 明
表 1 接 口 参 数 说 明
与 所 传 入 名 称 表 达 式 对 应 的 底 层mangling name;该 名 称 所 占 用 的 内 存 将 在 通 过aclrtcDestroyProg销 毁 程 序 对 象 时 自 动 释 放。 |
返 回 值 说 明
aclError为int类 型 变 量,详 细 说 明 请 参 考RTC错 误 码。
约 束 说 明
使 用 前 必 须 先 通 过aclrtcAddNameExpr注 册 原 始 名 称,且 两 次 传 入 的nameExpression字 符 串 必 须 完 全 相 同。
调 用 示 例
Text
aclrtcProg prog;
aclrtcCreateProg(&prog, src, "add_custom", 0, nullptr, nullptr);
const char* kernelNameExpr = "add_custom<float>";
aclrtcAddNameExpr(prog, kernelNameExpr);
const char *options[] = {
"--npu-arch=dav-2201",
};
int numOptions = sizeof(options) / sizeof(options[0]);
aclrtcCompileProg(prog, numOptions, options);
const char* manglingName = "";
aclrtcGetLoweredName(prog, kernelNameExpr, &manglingName);