Skip to content
版 本

aclrtcGetLoweredName

产 品 支 持 情 况

产 品

是 否 支 持

Ascend 950PR/Ascend 950DT

Atlas A3 训 练 系 列 产 品/Atlas A3 推 理 系 列 产 品

Atlas A2 训 练 系 列 产 品/Atlas A2 推 理 系 列 产 品

Atlas 200I/500 A2 推 理 产 品

x

Atlas 推 理 系 列 产 品AI Core

x

Atlas 推 理 系 列 产 品Vector Core

x

Atlas 训 练 系 列 产 品

x

功 能 说 明

获 取 已 经 注 册 的__global__函 数 的mangling name。

函 数 原 型

Text
aclError aclrtcGetLoweredName(aclrtcProg prog, const char *nameExpression, const char **loweredName)

参 数 说 明

表 1 接 口 参 数 说 明

参 数 名

输 入/输 出

描 述

prog

输 入

运 行 时 编 译 程 序 的 句 柄。

nameExpression

输 入

一 个 常 量 表 达 式,通 常 为 字 符 串 字 面 量,用 于 指 明 某 个__global__函 数。

loweredName

输 出

与 所 传 入 名 称 表 达 式 对 应 的 底 层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);

免 责 声 明:本 站 内 容 由 asc-devkit 仓 master 分 支 自 动 编 译 生 成,属 于 持 续 开 发 版 本,可 能 存 在 缺 陷,仅 供 预 览 与 参 考。如 需 稳 定 及 商 用 资 料,请 查 阅 官 方 昇 腾 社 区