已合并
revert: 回退 PR !3807 删除 aclrtDim3 统一使用 dim3 #3937
yanmingxiang创建于 7月29日
revert: 回退 PR !3807 删除 aclrtDim3 统一使用 dim3 #3937
已合并
共 6 个文件变更+76-263
| @@ -43,8 +43,6 @@ | |||
| 43 | - [`aclError aclrtFunctionGetParamInfo(const void *func, size_t paramIndex, size_t *paramOffset, size_t *paramSize)`](#aclrtFunctionGetParamInfo):根据索引从核函数句柄获取参数信息。 | 43 | - [`aclError aclrtFunctionGetParamInfo(const void *func, size_t paramIndex, size_t *paramOffset, size_t *paramSize)`](#aclrtFunctionGetParamInfo):根据索引从核函数句柄获取参数信息。 |
| 44 | - [`aclError aclrtFunctionGetAvailDynUbufPerBlock(void *func, uint32_t flags, size_t *dynamicUbufSize)`](#aclrtFunctionGetAvailDynUbufPerBlock):从核函数句柄获取每个Block可用的动态UB buffer大小。 | 44 | - [`aclError aclrtFunctionGetAvailDynUbufPerBlock(void *func, uint32_t flags, size_t *dynamicUbufSize)`](#aclrtFunctionGetAvailDynUbufPerBlock):从核函数句柄获取每个Block可用的动态UB buffer大小。 |
| 45 | - [`aclError aclrtGetFuncBySymbol(const void *symbol, aclrtFuncHandle *funcHandle)`](#aclrtGetFuncBySymbol):根据核函数名获取核函数句柄。 | 45 | - [`aclError aclrtGetFuncBySymbol(const void *symbol, aclrtFuncHandle *funcHandle)`](#aclrtGetFuncBySymbol):根据核函数名获取核函数句柄。 |
| 46 | -- [`aclError aclrtLaunchSIMTKernelWithArgsArray(void *func, dim3 gridDim, dim3 blockDim, size_t dynUbufSize, aclrtStream stream, aclrtLaunchKernelCfg *cfg, void **args)`](#aclrtLaunchSIMTKernelWithArgsArray):使用参数数组启动SIMT核函数计算任务,异步接口。 | ||
| 47 | -- [`aclError aclrtLaunchSIMTKernelWithHostArgs(void *func, dim3 gridDim, dim3 blockDim, size_t dynUbufSize, aclrtStream stream, aclrtLaunchKernelCfg *cfg, void *hostArgs, size_t argsSize, aclrtPlaceHolderInfo *placeHolderArray, size_t placeHolderNum)`](#aclrtLaunchSIMTKernelWithHostArgs):使用Host参数启动SIMT核函数计算任务,异步接口。 | ||
| 48 | 46 | ||
| 49 | ## 概念及使用说明 | 47 | ## 概念及使用说明 |
| 50 | 48 | ||
| @@ -1436,8 +1434,6 @@ aclError aclrtLaunchKernel(aclrtFuncHandle funcHandle, uint32_t numBlocks, const | |||
| 1436 | 1434 | ||
| 1437 | ### 参考资源 | 1435 | ### 参考资源 |
| 1438 | 1436 | ||
| 1439 | -<a id="launch_kernel_comparison"></a> | ||
| 1440 | - | ||
| 1441 | 下表的几个接口都用于启用对应算子的计算任务,但功能和使用方式有所不同: | 1437 | 下表的几个接口都用于启用对应算子的计算任务,但功能和使用方式有所不同: |
| 1442 | 1438 | ||
| 1443 | | 接口 | 核函数参数值的传入方式 | 核函数参数值的存放位置 | 是否可指定任务下发的配置信息 | | 1439 | | 接口 | 核函数参数值的传入方式 | 核函数参数值的存放位置 | 是否可指定任务下发的配置信息 | |
| @@ -1447,8 +1443,6 @@ aclError aclrtLaunchKernel(aclrtFuncHandle funcHandle, uint32_t numBlocks, const | |||
| 1447 | | [aclrtLaunchKernelWithConfig](#aclrtLaunchKernelWithConfig) | 在接口中指定参数列表句柄aclrtArgsHandle | Host内存 | 是 | | 1443 | | [aclrtLaunchKernelWithConfig](#aclrtLaunchKernelWithConfig) | 在接口中指定参数列表句柄aclrtArgsHandle | Host内存 | 是 | |
| 1448 | | [aclrtLaunchKernelWithHostArgs](#aclrtLaunchKernelWithHostArgs) | 在接口中指定存放核函数所有入参数据的Host内存地址指针 | Host内存 | 是 | | 1444 | | [aclrtLaunchKernelWithHostArgs](#aclrtLaunchKernelWithHostArgs) | 在接口中指定存放核函数所有入参数据的Host内存地址指针 | Host内存 | 是 | |
| 1449 | | [aclrtLaunchKernelWithArgsArray](#aclrtLaunchKernelWithArgsArray) | 在接口中指定参数数组指针,每个元素指向一个参数数据 | Host内存 | 是 | | 1445 | | [aclrtLaunchKernelWithArgsArray](#aclrtLaunchKernelWithArgsArray) | 在接口中指定参数数组指针,每个元素指向一个参数数据 | Host内存 | 是 | |
| 1450 | -| [aclrtLaunchSIMTKernelWithArgsArray](#aclrtLaunchSIMTKernelWithArgsArray) | 用于SIMT核函数,在接口中指定参数数组指针,每个元素指向一个参数数据 | Host内存 | 是 | | ||
| 1451 | -| [aclrtLaunchSIMTKernelWithHostArgs](#aclrtLaunchSIMTKernelWithHostArgs) | 用于SIMT核函数,在接口中指定存放核函数所有入参数据的Host内存地址指针 | Host内存 | 是 | | ||
| 1452 | 1446 | ||
| 1453 | <br> | 1447 | <br> |
| 1454 | <br> | 1448 | <br> |
| @@ -1508,7 +1502,15 @@ aclError aclrtLaunchKernelV2(aclrtFuncHandle funcHandle, uint32_t numBlocks, con | |||
| 1508 | 1502 | ||
| 1509 | ### 参考资源 | 1503 | ### 参考资源 |
| 1510 | 1504 | ||
| 1511 | -各Launch接口的功能和使用方式对比请参见[Launch接口对比表](#launch_kernel_comparison)。 | 1505 | +下表的几个接口都用于启用对应算子的计算任务,但功能和使用方式有所不同: |
| 1506 | + | ||
| 1507 | +| 接口 | 核函数参数值的传入方式 | 核函数参数值的存放位置 | 是否可指定任务下发的配置信息 | | ||
| 1508 | +| --- | --- | --- | --- | | ||
| 1509 | +| [aclrtLaunchKernel](#aclrtLaunchKernel) | 在接口中指定存放核函数所有入参数据的Device内存地址指针 | Device内存 | 否 | | ||
| 1510 | +| [aclrtLaunchKernelV2](#aclrtLaunchKernelV2) | 在接口中指定存放核函数所有入参数据的Device内存地址指针 | Device内存 | 是 | | ||
| 1511 | +| [aclrtLaunchKernelWithConfig](#aclrtLaunchKernelWithConfig) | 在接口中指定参数列表句柄aclrtArgsHandle | Host内存 | 是 | | ||
| 1512 | +| [aclrtLaunchKernelWithHostArgs](#aclrtLaunchKernelWithHostArgs) | 在接口中指定存放核函数所有入参数据的Host内存地址指针 | Host内存 | 是 | | ||
| 1513 | +| [aclrtLaunchKernelWithArgsArray](#aclrtLaunchKernelWithArgsArray) | 在接口中指定参数数组指针,每个元素指向一个参数数据 | Host内存 | 是 | | ||
| 1512 | 1514 | ||
| 1513 | <br> | 1515 | <br> |
| 1514 | <br> | 1516 | <br> |
| @@ -1570,7 +1572,15 @@ aclError aclrtLaunchKernelWithConfig(aclrtFuncHandle funcHandle, uint32_t numBlo | |||
| 1570 | 1572 | ||
| 1571 | ### 参考资源 | 1573 | ### 参考资源 |
| 1572 | 1574 | ||
| 1573 | -各Launch接口的功能和使用方式对比请参见[Launch接口对比表](#launch_kernel_comparison)。 | 1575 | +下表的几个接口都用于启用对应算子的计算任务,但功能和使用方式有所不同: |
| 1576 | + | ||
| 1577 | +| 接口 | 核函数参数值的传入方式 | 核函数参数值的存放位置 | 是否可指定任务下发的配置信息 | | ||
| 1578 | +| --- | --- | --- | --- | | ||
| 1579 | +| [aclrtLaunchKernel](#aclrtLaunchKernel) | 在接口中指定存放核函数所有入参数据的Device内存地址指针 | Device内存 | 否 | | ||
| 1580 | +| [aclrtLaunchKernelV2](#aclrtLaunchKernelV2) | 在接口中指定存放核函数所有入参数据的Device内存地址指针 | Device内存 | 是 | | ||
| 1581 | +| [aclrtLaunchKernelWithConfig](#aclrtLaunchKernelWithConfig) | 在接口中指定参数列表句柄aclrtArgsHandle | Host内存 | 是 | | ||
| 1582 | +| [aclrtLaunchKernelWithHostArgs](#aclrtLaunchKernelWithHostArgs) | 在接口中指定存放核函数所有入参数据的Host内存地址指针 | Host内存 | 是 | | ||
| 1583 | +| [aclrtLaunchKernelWithArgsArray](#aclrtLaunchKernelWithArgsArray) | 在接口中指定参数数组指针,每个元素指向一个参数数据 | Host内存 | 是 | | ||
| 1574 | 1584 | ||
| 1575 | <br> | 1585 | <br> |
| 1576 | <br> | 1586 | <br> |
| @@ -1623,7 +1633,7 @@ aclError aclrtLaunchKernelWithHostArgs(aclrtFuncHandle funcHandle, uint32_t numB | |||
| 1623 | | cfg | 输入 | 任务下发的配置信息。类型定义请参见[aclrtLaunchKernelCfg](25-04_Structs.md#aclrtLaunchKernelCfg)。<br>不指定配置时,此处可传NULL。 | | 1633 | | cfg | 输入 | 任务下发的配置信息。类型定义请参见[aclrtLaunchKernelCfg](25-04_Structs.md#aclrtLaunchKernelCfg)。<br>不指定配置时,此处可传NULL。 | |
| 1624 | | hostArgs | 输入 | 存放核函数所有入参数据的Host内存地址指针。 | | 1634 | | hostArgs | 输入 | 存放核函数所有入参数据的Host内存地址指针。 | |
| 1625 | | argsSize | 输入 | hostArgs参数值的大小,单位为Byte。 | | 1635 | | argsSize | 输入 | hostArgs参数值的大小,单位为Byte。 | |
| 1626 | -| placeHolderArray | 输入 | placeholder参数数组。类型定义请参见[aclrtPlaceHolderInfo](25-04_Structs.md#aclrtPlaceHolderInfo)。 | | 1636 | +| placeHolderArray | 输入 | placeholder参数数组。<br>aclrtPlaceHolderInfo定义如下:<br>typedef struct {<br> uint32_t addrOffset;<br> uint32_t dataOffset;<br>} aclrtPlaceHolderInfo;<br>成员变量说明如下:<br><br> - addrOffset:placeholder指向的数据区拷贝到Device后,其真实Device内存地址在launch时需要刷新到hostArgs中,该参数用于指定需刷新的位置偏移<br> - dataOffset:placeholder指向的数据区需拷贝到Device侧,该参数用于指定数据区基于hostArgs的地址偏移 | |
| 1627 | | placeHolderNum | 输入 | placeholder参数数组的大小。 | | 1637 | | placeHolderNum | 输入 | placeholder参数数组的大小。 | |
| 1628 | 1638 | ||
| 1629 | ### 返回值说明 | 1639 | ### 返回值说明 |
| @@ -1632,7 +1642,15 @@ aclError aclrtLaunchKernelWithHostArgs(aclrtFuncHandle funcHandle, uint32_t numB | |||
| 1632 | 1642 | ||
| 1633 | ### 参考资源 | 1643 | ### 参考资源 |
| 1634 | 1644 | ||
| 1635 | -各Launch接口的功能和使用方式对比请参见[Launch接口对比表](#launch_kernel_comparison)。 | 1645 | +下表的几个接口都用于启用对应算子的计算任务,但功能和使用方式有所不同: |
| 1646 | + | ||
| 1647 | +| 接口 | 核函数参数值的传入方式 | 核函数参数值的存放位置 | 是否可指定任务下发的配置信息 | | ||
| 1648 | +| --- | --- | --- | --- | | ||
| 1649 | +| [aclrtLaunchKernel](#aclrtLaunchKernel) | 在接口中指定存放核函数所有入参数据的Device内存地址指针 | Device内存 | 否 | | ||
| 1650 | +| [aclrtLaunchKernelV2](#aclrtLaunchKernelV2) | 在接口中指定存放核函数所有入参数据的Device内存地址指针 | Device内存 | 是 | | ||
| 1651 | +| [aclrtLaunchKernelWithConfig](#aclrtLaunchKernelWithConfig) | 在接口中指定参数列表句柄aclrtArgsHandle | Host内存 | 是 | | ||
| 1652 | +| [aclrtLaunchKernelWithHostArgs](#aclrtLaunchKernelWithHostArgs) | 在接口中指定存放核函数所有入参数据的Host内存地址指针 | Host内存 | 是 | | ||
| 1653 | +| [aclrtLaunchKernelWithArgsArray](#aclrtLaunchKernelWithArgsArray) | 在接口中指定参数数组指针,每个元素指向一个参数数据 | Host内存 | 是 | | ||
| 1636 | 1654 | ||
| 1637 | <br> | 1655 | <br> |
| 1638 | <br> | 1656 | <br> |
| @@ -1679,7 +1697,7 @@ aclError aclrtLaunchKernelWithArgsArray(void *func, uint32_t numBlocks, aclrtStr | |||
| 1679 | 1697 | ||
| 1680 | | 参数名 | 输入/输出 | 说明 | | 1698 | | 参数名 | 输入/输出 | 说明 | |
| 1681 | | --- | :---: | --- | | 1699 | | --- | :---: | --- | |
| 1682 | -| func | 输入 | 内核函数指针。此处可以是`__global__`声明的核函数名(比如myKernel),也可以是[aclrtFuncHandle](25-05_Typedefs.md#aclrtFuncHandle)类型的核函数句柄。 | | 1700 | +| func | 输入 | 内核函数指针(可以是符号或[aclrtFuncHandle](25-05_Typedefs.md#aclrtFuncHandle))。 | |
| 1683 | | numBlocks | 输入 | 指定核函数将会在几个核上执行。 | | 1701 | | numBlocks | 输入 | 指定核函数将会在几个核上执行。 | |
| 1684 | | stream | 输入 | 指定执行任务的Stream。类型定义请参见[aclrtStream](25-05_Typedefs.md#aclrtStream)。 | | 1702 | | stream | 输入 | 指定执行任务的Stream。类型定义请参见[aclrtStream](25-05_Typedefs.md#aclrtStream)。 | |
| 1685 | | cfg | 输入 | 任务下发的配置信息。类型定义请参见[aclrtLaunchKernelCfg](25-04_Structs.md#aclrtLaunchKernelCfg)。<br>不指定配置时,此处可传NULL。 | | 1703 | | cfg | 输入 | 任务下发的配置信息。类型定义请参见[aclrtLaunchKernelCfg](25-04_Structs.md#aclrtLaunchKernelCfg)。<br>不指定配置时,此处可传NULL。 | |
| @@ -1695,7 +1713,15 @@ aclError aclrtLaunchKernelWithArgsArray(void *func, uint32_t numBlocks, aclrtStr | |||
| 1695 | 1713 | ||
| 1696 | ### 参考资源 | 1714 | ### 参考资源 |
| 1697 | 1715 | ||
| 1698 | -各Launch接口的功能和使用方式对比请参见[Launch接口对比表](#launch_kernel_comparison)。 | 1716 | +下表的几个接口都用于启用对应算子的计算任务,但功能和使用方式有所不同: |
| 1717 | + | ||
| 1718 | +| 接口 | 核函数参数值的传入方式 | 核函数参数值的存放位置 | 是否可指定任务下发的配置信息 | | ||
| 1719 | +| --- | --- | --- | --- | | ||
| 1720 | +| [aclrtLaunchKernel](#aclrtLaunchKernel) | 在接口中指定存放核函数所有入参数据的Device内存地址指针 | Device内存 | 否 | | ||
| 1721 | +| [aclrtLaunchKernelV2](#aclrtLaunchKernelV2) | 在接口中指定存放核函数所有入参数据的Device内存地址指针 | Device内存 | 是 | | ||
| 1722 | +| [aclrtLaunchKernelWithConfig](#aclrtLaunchKernelWithConfig) | 在接口中指定参数列表句柄aclrtArgsHandle | Host内存 | 是 | | ||
| 1723 | +| [aclrtLaunchKernelWithHostArgs](#aclrtLaunchKernelWithHostArgs) | 在接口中指定存放核函数所有入参数据的Host内存地址指针 | Host内存 | 是 | | ||
| 1724 | +| [aclrtLaunchKernelWithArgsArray](#aclrtLaunchKernelWithArgsArray) | 在接口中指定参数数组指针,每个元素指向一个参数数据 | Host内存 | 是 | | ||
| 1699 | 1725 | ||
| 1700 | <br> | 1726 | <br> |
| 1701 | <br> | 1727 | <br> |
| @@ -2201,139 +2227,3 @@ aclError aclrtGetFuncBySymbol(const void *symbol, aclrtFuncHandle *funcHandle) | |||
| 2201 | 2227 | ||
| 2202 | - 本接口只能用于算子静态Shape场景,且仅支持AI Core算子。 | 2228 | - 本接口只能用于算子静态Shape场景,且仅支持AI Core算子。 |
| 2203 | - 核函数句柄仅在当前Device有效,切换Device后需要重新获取。 | 2229 | - 核函数句柄仅在当前Device有效,切换Device后需要重新获取。 |
| 2204 | - | ||
| 2205 | -<br> | ||
| 2206 | -<br> | ||
| 2207 | -<br> | ||
| 2208 | - | ||
| 2209 | -<a id="aclrtLaunchSIMTKernelWithArgsArray"></a> | ||
| 2210 | - | ||
| 2211 | -## aclrtLaunchSIMTKernelWithArgsArray | ||
| 2212 | - | ||
| 2213 | -```c | ||
| 2214 | -aclError aclrtLaunchSIMTKernelWithArgsArray(void *func, dim3 gridDim, dim3 blockDim, size_t dynUbufSize, aclrtStream stream, aclrtLaunchKernelCfg *cfg, void **args) | ||
| 2215 | -``` | ||
| 2216 | - | ||
| 2217 | -### 产品支持情况 | ||
| 2218 | - | ||
| 2219 | -<!-- npu="950" id3494 --> | ||
| 2220 | -- Ascend 950PR/Ascend 950DT:支持 | ||
| 2221 | -<!-- end id3494 --> | ||
| 2222 | -<!-- npu="A3" id3495 --> | ||
| 2223 | -- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 2224 | -<!-- end id3495 --> | ||
| 2225 | -<!-- npu="910b" id3496 --> | ||
| 2226 | -- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 2227 | -<!-- end id3496 --> | ||
| 2228 | -<!-- npu="310b" id3497 --> | ||
| 2229 | -- Atlas 200I/500 A2 推理产品:不支持 | ||
| 2230 | -<!-- end id3497 --> | ||
| 2231 | -<!-- npu="310p" id3498 --> | ||
| 2232 | -- Atlas 推理系列产品:不支持 | ||
| 2233 | -<!-- end id3498 --> | ||
| 2234 | -<!-- npu="910" id3499 --> | ||
| 2235 | -- Atlas 训练系列产品:不支持 | ||
| 2236 | -<!-- end id3499 --> | ||
| 2237 | -<!-- npu="IPV350" id3500 --> | ||
| 2238 | -- IPV350:不支持 | ||
| 2239 | -<!-- end id3500 --> | ||
| 2240 | -<!-- @ref: runtime/res/docs/zh/api_ref/14_kerne_loading_and_execution_res.md#id39 --> | ||
| 2241 | - | ||
| 2242 | -### 功能说明 | ||
| 2243 | - | ||
| 2244 | -基于参数数组的方式传递SIMT(Single Instruction Multiple Thread)核函数入参,并启动对应算子的计算任务。异步接口。 | ||
| 2245 | - | ||
| 2246 | - | ||
| 2247 | -### 参数说明 | ||
| 2248 | - | ||
| 2249 | -| 参数名 | 输入/输出 | 说明 | | ||
| 2250 | -| --- | :---: | --- | | ||
| 2251 | -| func | 输入 | 内核函数指针。此处可以是`__global__`声明的核函数名(比如myKernel),也可以是[aclrtFuncHandle](25-05_Typedefs.md#aclrtFuncHandle)类型的核函数句柄。 | | ||
| 2252 | -| gridDim | 输入 | 线程块网格,由多个线程块(Thread Block)组成。Grid采用三维结构,其维度X、Y和Z分别表示不同维度下线程块的大小。类型定义请参见[dim3](25-04_Structs.md#dim3)。 | | ||
| 2253 | -| blockDim | 输入 | 线程块(Thread Block),采用三维结构,其维度X、Y和Z分别表示线程块中三个维度的线程数。类型定义请参见[dim3](25-04_Structs.md#dim3)。 | | ||
| 2254 | -| dynUbufSize | 输入 | 用于指定SIMT(Single Instruction Multiple Thread)算子执行时需要的UB(Unified Buffer,统一缓冲区)动态内存大小,单位Byte。若cfg中同时设置了ACL_RT_LAUNCH_KERNEL_ATTR_DYN_UBUF_SIZE属性,本参数的优先级更高。 | | ||
| 2255 | -| stream | 输入 | 指定执行任务的Stream。类型定义请参见[aclrtStream](25-05_Typedefs.md#aclrtStream)。 | | ||
| 2256 | -| cfg | 输入 | 任务下发的配置信息。类型定义请参见[aclrtLaunchKernelCfg](25-04_Structs.md#aclrtLaunchKernelCfg)。<br>不指定配置时,此处可传NULL。 | | ||
| 2257 | -| args | 输入 | 参数数组指针。<br/>参数数组中的每个元素均指向核函数参数数据在Host侧的内存地址。 | | ||
| 2258 | - | ||
| 2259 | -### 返回值说明 | ||
| 2260 | - | ||
| 2261 | -返回0表示成功,返回其他值表示失败,请参见[aclError](25-01_aclError.md#aclError)。 | ||
| 2262 | - | ||
| 2263 | -### 约束说明 | ||
| 2264 | - | ||
| 2265 | -参数数组中的元素顺序需与核函数参数顺序保持一致,且参数数组大小需与核函数参数数量保持一致,否则会导致未定义行为。 | ||
| 2266 | - | ||
| 2267 | -### 参考资源 | ||
| 2268 | - | ||
| 2269 | -各Launch接口的功能和使用方式对比请参见[Launch接口对比表](#launch_kernel_comparison)。 | ||
| 2270 | - | ||
| 2271 | -<br> | ||
| 2272 | -<br> | ||
| 2273 | -<br> | ||
| 2274 | - | ||
| 2275 | -<a id="aclrtLaunchSIMTKernelWithHostArgs"></a> | ||
| 2276 | - | ||
| 2277 | -## aclrtLaunchSIMTKernelWithHostArgs | ||
| 2278 | - | ||
| 2279 | -```c | ||
| 2280 | -aclError aclrtLaunchSIMTKernelWithHostArgs(void *func, dim3 gridDim, dim3 blockDim, size_t dynUbufSize, aclrtStream stream, aclrtLaunchKernelCfg *cfg, void *hostArgs, size_t argsSize, aclrtPlaceHolderInfo *placeHolderArray, size_t placeHolderNum) | ||
| 2281 | -``` | ||
| 2282 | - | ||
| 2283 | -### 产品支持情况 | ||
| 2284 | - | ||
| 2285 | -<!-- npu="950" id3501 --> | ||
| 2286 | -- Ascend 950PR/Ascend 950DT:支持 | ||
| 2287 | -<!-- end id3501 --> | ||
| 2288 | -<!-- npu="A3" id3502 --> | ||
| 2289 | -- Atlas A3 训练系列产品/Atlas A3 推理系列产品:不支持 | ||
| 2290 | -<!-- end id3502 --> | ||
| 2291 | -<!-- npu="910b" id3503 --> | ||
| 2292 | -- Atlas A2 训练系列产品/Atlas A2 推理系列产品:不支持 | ||
| 2293 | -<!-- end id3503 --> | ||
| 2294 | -<!-- npu="310b" id3504 --> | ||
| 2295 | -- Atlas 200I/500 A2 推理产品:不支持 | ||
| 2296 | -<!-- end id3504 --> | ||
| 2297 | -<!-- npu="310p" id3505 --> | ||
| 2298 | -- Atlas 推理系列产品:不支持 | ||
| 2299 | -<!-- end id3505 --> | ||
| 2300 | -<!-- npu="910" id3506 --> | ||
| 2301 | -- Atlas 训练系列产品:不支持 | ||
| 2302 | -<!-- end id3506 --> | ||
| 2303 | -<!-- npu="IPV350" id3507 --> | ||
| 2304 | -- IPV350:不支持 | ||
| 2305 | -<!-- end id3507 --> | ||
| 2306 | -<!-- @ref: runtime/res/docs/zh/api_ref/14_kerne_loading_and_execution_res.md#id40 --> | ||
| 2307 | - | ||
| 2308 | -### 功能说明 | ||
| 2309 | - | ||
| 2310 | -基于Host内存参数的方式传递SIMT(Single Instruction Multiple Thread)核函数入参,并启动对应算子的计算任务。异步接口。 | ||
| 2311 | - | ||
| 2312 | - | ||
| 2313 | -### 参数说明 | ||
| 2314 | - | ||
| 2315 | -| 参数名 | 输入/输出 | 说明 | | ||
| 2316 | -| --- | :---: | --- | | ||
| 2317 | -| func | 输入 | 内核函数指针。此处可以是`__global__`声明的核函数名(比如myKernel),也可以是[aclrtFuncHandle](25-05_Typedefs.md#aclrtFuncHandle)类型的核函数句柄。 | | ||
| 2318 | -| gridDim | 输入 | 线程块网格,由多个线程块(Thread Block)组成。Grid采用三维结构,其维度X、Y和Z分别表示不同维度下线程块的大小。类型定义请参见[dim3](25-04_Structs.md#dim3)。 | | ||
| 2319 | -| blockDim | 输入 | 线程块(Thread Block),采用三维结构,其维度X、Y和Z分别表示线程块中三个维度的线程数。类型定义请参见[dim3](25-04_Structs.md#dim3)。 | | ||
| 2320 | -| dynUbufSize | 输入 | 用于指定SIMT(Single Instruction Multiple Thread)算子执行时需要的UB(Unified Buffer,统一缓冲区)动态内存大小,单位Byte。若cfg中同时设置了ACL_RT_LAUNCH_KERNEL_ATTR_DYN_UBUF_SIZE属性,本参数的优先级更高。 | | ||
| 2321 | -| stream | 输入 | 指定执行任务的Stream。类型定义请参见[aclrtStream](25-05_Typedefs.md#aclrtStream)。 | | ||
| 2322 | -| cfg | 输入 | 任务下发的配置信息。类型定义请参见[aclrtLaunchKernelCfg](25-04_Structs.md#aclrtLaunchKernelCfg)。<br>不指定配置时,此处可传NULL。 | | ||
| 2323 | -| hostArgs | 输入 | 存放核函数所有入参数据的Host内存地址指针。 | | ||
| 2324 | -| argsSize | 输入 | hostArgs参数值的大小,单位为Byte。 | | ||
| 2325 | -| placeHolderArray | 输入 | placeholder参数数组。类型定义请参见[aclrtPlaceHolderInfo](25-04_Structs.md#aclrtPlaceHolderInfo)。 | | ||
| 2326 | -| placeHolderNum | 输入 | placeholder参数数组的大小。 | | ||
| 2327 | - | ||
| 2328 | -### 返回值说明 | ||
| 2329 | - | ||
| 2330 | -返回0表示成功,返回其他值表示失败,请参见[aclError](25-01_aclError.md#aclError)。 | ||
| 2331 | - | ||
| 2332 | -### 约束说明 | ||
| 2333 | - | ||
| 2334 | -- hostArgs内存需按核函数参数顺序紧凑排列,且argsSize需与实际参数总大小一致。 | ||
| 2335 | -- placeHolderArray中的地址偏移必须与hostArgs中placeholder参数的实际位置对应。 | ||
| 2336 | - | ||
| 2337 | -### 参考资源 | ||
| 2338 | - | ||
| 2339 | -各Launch接口的功能和使用方式对比请参见[Launch接口对比表](#launch_kernel_comparison)。 | ||
| @@ -36,7 +36,6 @@ struct 类型数据。 | |||
| 36 | - [aclrtMemUsageInfo](#aclrtMemUsageInfo) | 36 | - [aclrtMemUsageInfo](#aclrtMemUsageInfo) |
| 37 | - [aclrtNormalDisInfo](#aclrtNormalDisInfo) | 37 | - [aclrtNormalDisInfo](#aclrtNormalDisInfo) |
| 38 | - [aclrtPhysicalMemProp](#aclrtPhysicalMemProp) | 38 | - [aclrtPhysicalMemProp](#aclrtPhysicalMemProp) |
| 39 | -- [aclrtPlaceHolderInfo](#aclrtPlaceHolderInfo) | ||
| 40 | - [aclrtPtrAttributes](#aclrtPtrAttributes) | 39 | - [aclrtPtrAttributes](#aclrtPtrAttributes) |
| 41 | - [aclrtRandomNumFuncParaInfo](#aclrtRandomNumFuncParaInfo) | 40 | - [aclrtRandomNumFuncParaInfo](#aclrtRandomNumFuncParaInfo) |
| 42 | - [aclrtRandomNumTaskInfo](#aclrtRandomNumTaskInfo) | 41 | - [aclrtRandomNumTaskInfo](#aclrtRandomNumTaskInfo) |
| @@ -51,7 +50,6 @@ struct 类型数据。 | |||
| 51 | - [aclrtUniformDisInfo](#aclrtUniformDisInfo) | 50 | - [aclrtUniformDisInfo](#aclrtUniformDisInfo) |
| 52 | - [aclrtUtilizationInfo](#aclrtUtilizationInfo) | 51 | - [aclrtUtilizationInfo](#aclrtUtilizationInfo) |
| 53 | - [aclrtUuid](#aclrtUuid) | 52 | - [aclrtUuid](#aclrtUuid) |
| 54 | -- [dim3](#dim3) | ||
| 55 | 53 | ||
| 56 | <br> | 54 | <br> |
| 57 | 55 | ||
| @@ -819,24 +817,6 @@ typedef struct aclrtPhysicalMemProp { | |||
| 819 | 817 | ||
| 820 | <br> | 818 | <br> |
| 821 | 819 | ||
| 822 | -<a id="aclrtPlaceHolderInfo"></a> | ||
| 823 | - | ||
| 824 | -## aclrtPlaceHolderInfo | ||
| 825 | - | ||
| 826 | -```c | ||
| 827 | -typedef struct { | ||
| 828 | - uint32_t addrOffset; | ||
| 829 | - uint32_t dataOffset; | ||
| 830 | -} aclrtPlaceHolderInfo; | ||
| 831 | -``` | ||
| 832 | - | ||
| 833 | -| 成员名称 | 说明 | | ||
| 834 | -| --- | --- | | ||
| 835 | -| addrOffset | 待刷新的位置偏移。launch时,Runtime会申请Device内存并将该Device内存地址刷新到hostArgs中,该参数用于指定需刷新的位置偏移。 | | ||
| 836 | -| dataOffset | 数据区的偏移。placeholder指向的数据区需拷贝到Device侧,该参数用于指定数据区基于hostArgs的地址偏移。 | | ||
| 837 | - | ||
| 838 | -<br> | ||
| 839 | - | ||
| 840 | <a id="aclrtPtrAttributes"></a> | 820 | <a id="aclrtPtrAttributes"></a> |
| 841 | 821 | ||
| 842 | ## aclrtPtrAttributes | 822 | ## aclrtPtrAttributes |
| @@ -1117,29 +1097,3 @@ typedef struct aclrtUtilizationInfo { | |||
| 1117 | char bytes[16]; // 一个16字节的字符串,作为Device的唯一标识 | 1097 | char bytes[16]; // 一个16字节的字符串,作为Device的唯一标识 |
| 1118 | } aclrtUuid; | 1098 | } aclrtUuid; |
| 1119 | ``` | 1099 | ``` |
| 1120 | - | ||
| 1121 | -<br> | ||
| 1122 | - | ||
| 1123 | -<a id="dim3"></a> | ||
| 1124 | - | ||
| 1125 | -## dim3 | ||
| 1126 | - | ||
| 1127 | -```c | ||
| 1128 | -typedef struct dim3 { | ||
| 1129 | - uint32_t x; | ||
| 1130 | - uint32_t y; | ||
| 1131 | - uint32_t z; | ||
| 1132 | -#ifdef __cplusplus | ||
| 1133 | -#if __cplusplus >= 201103L | ||
| 1134 | - constexpr dim3(uint32_t vx = 1, uint32_t vy = 1, uint32_t vz = 1) : x(vx), y(vy), z(vz) {} | ||
| 1135 | -#else | ||
| 1136 | - dim3(uint32_t vx = 1, uint32_t vy = 1, uint32_t vz = 1) : x(vx), y(vy), z(vz) {} | ||
| 1137 | -#endif | ||
| 1138 | -#endif // __cplusplus | ||
| 1139 | -} dim3; | ||
| 1140 | -``` | ||
| 1141 | - | ||
| 1142 | -- C++环境下,dim3提供默认构造函数,三个成员变量默认初始化为1。 | ||
| 1143 | -- C语言环境下,dim3为普通结构体,使用时需显式初始化各成员变量。 | ||
| 1144 | - | ||
| 1145 | -<br> | ||
| @@ -504,20 +504,11 @@ typedef enum { | |||
| 504 | ACL_RT_ENGINE_TYPE_AIV, | 504 | ACL_RT_ENGINE_TYPE_AIV, |
| 505 | } aclrtEngineType; | 505 | } aclrtEngineType; |
| 506 | 506 | ||
| 507 | -#ifndef __BISHENG_CCEC__ | 507 | +typedef struct aclrtDim3 { |
| 508 | -typedef struct dim3 { | ||
| 509 | uint32_t x; | 508 | uint32_t x; |
| 510 | uint32_t y; | 509 | uint32_t y; |
| 511 | uint32_t z; | 510 | uint32_t z; |
| 512 | -#ifdef __cplusplus | 511 | +} aclrtDim3; |
| 513 | - | ||
| 514 | - constexpr dim3(uint32_t vx = 1, uint32_t vy = 1, uint32_t vz = 1) : x(vx), y(vy), z(vz) {} | ||
| 515 | - | ||
| 516 | - dim3(uint32_t vx = 1, uint32_t vy = 1, uint32_t vz = 1) : x(vx), y(vy), z(vz) {} | ||
| 517 | - | ||
| 518 | - | ||
| 519 | -} dim3; | ||
| 520 | - | ||
| 521 | 512 | ||
| 522 | typedef enum aclrtLaunchKernelAttrId { | 513 | typedef enum aclrtLaunchKernelAttrId { |
| 523 | ACL_RT_LAUNCH_KERNEL_ATTR_SCHEM_MODE = 1, | 514 | ACL_RT_LAUNCH_KERNEL_ATTR_SCHEM_MODE = 1, |
| @@ -5183,7 +5174,7 @@ ACL_FUNC_VISIBILITY aclError aclrtLaunchKernelWithArgsArray( | |||
| 5183 | * @retval OtherValues Failure | 5174 | * @retval OtherValues Failure |
| 5184 | */ | 5175 | */ |
| 5185 | ACL_FUNC_VISIBILITY aclError aclrtLaunchSIMTKernelWithArgsArray( | 5176 | ACL_FUNC_VISIBILITY aclError aclrtLaunchSIMTKernelWithArgsArray( |
| 5186 | - void* func, dim3 gridDim, dim3 blockDim, size_t dynUbufSize, aclrtStream stream, | 5177 | + void* func, aclrtDim3 gridDim, aclrtDim3 blockDim, size_t dynUbufSize, aclrtStream stream, |
| 5187 | aclrtLaunchKernelCfg* cfg, void** args); | 5178 | aclrtLaunchKernelCfg* cfg, void** args); |
| 5188 | 5179 | ||
| 5189 | /** | 5180 | /** |
| @@ -5204,7 +5195,7 @@ ACL_FUNC_VISIBILITY aclError aclrtLaunchSIMTKernelWithArgsArray( | |||
| 5204 | * @retval OtherValues Failure | 5195 | * @retval OtherValues Failure |
| 5205 | */ | 5196 | */ |
| 5206 | ACL_FUNC_VISIBILITY aclError aclrtLaunchSIMTKernelWithHostArgs( | 5197 | ACL_FUNC_VISIBILITY aclError aclrtLaunchSIMTKernelWithHostArgs( |
| 5207 | - void* func, dim3 gridDim, dim3 blockDim, size_t dynUbufSize, aclrtStream stream, | 5198 | + void* func, aclrtDim3 gridDim, aclrtDim3 blockDim, size_t dynUbufSize, aclrtStream stream, |
| 5208 | aclrtLaunchKernelCfg* cfg, void* hostArgs, size_t argsSize, aclrtPlaceHolderInfo* placeHolderArray, | 5199 | aclrtLaunchKernelCfg* cfg, void* hostArgs, size_t argsSize, aclrtPlaceHolderInfo* placeHolderArray, |
| 5209 | size_t placeHolderNum); | 5200 | size_t placeHolderNum); |
| 5210 | 5201 | ||
| @@ -431,12 +431,13 @@ | |||
| 431 | (void* func, uint32_t numBlocks, aclrtStream stream, aclrtLaunchKernelCfg* cfg, void** args), \ | 431 | (void* func, uint32_t numBlocks, aclrtStream stream, aclrtLaunchKernelCfg* cfg, void** args), \ |
| 432 | (func, numBlocks, stream, cfg, args)) \ | 432 | (func, numBlocks, stream, cfg, args)) \ |
| 433 | _(aclError, aclrtLaunchSIMTKernelWithArgsArray, \ | 433 | _(aclError, aclrtLaunchSIMTKernelWithArgsArray, \ |
| 434 | - (void* func, dim3 gridDim, dim3 blockDim, size_t dynUbufSize, aclrtStream stream, aclrtLaunchKernelCfg* cfg, \ | 434 | + (void* func, aclrtDim3 gridDim, aclrtDim3 blockDim, size_t dynUbufSize, aclrtStream stream, \ |
| 435 | - void** args), \ | 435 | + aclrtLaunchKernelCfg* cfg, void** args), \ |
| 436 | (func, gridDim, blockDim, dynUbufSize, stream, cfg, args)) \ | 436 | (func, gridDim, blockDim, dynUbufSize, stream, cfg, args)) \ |
| 437 | _(aclError, aclrtLaunchSIMTKernelWithHostArgs, \ | 437 | _(aclError, aclrtLaunchSIMTKernelWithHostArgs, \ |
| 438 | - (void* func, dim3 gridDim, dim3 blockDim, size_t dynUbufSize, aclrtStream stream, aclrtLaunchKernelCfg* cfg, \ | 438 | + (void* func, aclrtDim3 gridDim, aclrtDim3 blockDim, size_t dynUbufSize, aclrtStream stream, \ |
| 439 | - void* hostArgs, size_t argsSize, aclrtPlaceHolderInfo* placeHolderArray, size_t placeHolderNum), \ | 439 | + aclrtLaunchKernelCfg* cfg, void* hostArgs, size_t argsSize, aclrtPlaceHolderInfo* placeHolderArray, \ |
| 440 | + size_t placeHolderNum), \ | ||
| 440 | (func, gridDim, blockDim, dynUbufSize, stream, cfg, hostArgs, argsSize, placeHolderArray, placeHolderNum)) \ | 441 | (func, gridDim, blockDim, dynUbufSize, stream, cfg, hostArgs, argsSize, placeHolderArray, placeHolderNum)) \ |
| 441 | _(aclError, aclrtCtxGetFloatOverflowAddr, (void** overflowAddr), (overflowAddr)) \ | 442 | _(aclError, aclrtCtxGetFloatOverflowAddr, (void** overflowAddr), (overflowAddr)) \ |
| 442 | _(aclError, aclrtGetFloatOverflowStatus, (void* outputAddr, uint64_t outputSize, aclrtStream stream), \ | 443 | _(aclError, aclrtGetFloatOverflowStatus, (void* outputAddr, uint64_t outputSize, aclrtStream stream), \ |
| @@ -550,8 +550,8 @@ aclError aclrtLaunchKernelWithArgsArrayImpl( | |||
| 550 | } | 550 | } |
| 551 | 551 | ||
| 552 | aclError aclrtLaunchSIMTKernelWithArgsArrayImpl( | 552 | aclError aclrtLaunchSIMTKernelWithArgsArrayImpl( |
| 553 | - void* func, dim3 gridDim, dim3 blockDim, size_t dynUbufSize, aclrtStream stream, aclrtLaunchKernelCfg* cfg, | 553 | + void* func, aclrtDim3 gridDim, aclrtDim3 blockDim, size_t dynUbufSize, aclrtStream stream, |
| 554 | - void** args) | 554 | + aclrtLaunchKernelCfg* cfg, void** args) |
| 555 | { | 555 | { |
| 556 | ACL_PROFILING_REG(acl::AclProfType::AclrtLaunchSIMTKernelWithArgsArray); | 556 | ACL_PROFILING_REG(acl::AclProfType::AclrtLaunchSIMTKernelWithArgsArray); |
| 557 | ACL_LOG_INFO("Start to execute aclrtLaunchSIMTKernelWithArgsArray"); | 557 | ACL_LOG_INFO("Start to execute aclrtLaunchSIMTKernelWithArgsArray"); |
| @@ -586,8 +586,9 @@ aclError aclrtGetFloatOverflowStatusImpl(void* outputAddr, uint64_t outputSize, | |||
| 586 | } | 586 | } |
| 587 | 587 | ||
| 588 | aclError aclrtLaunchSIMTKernelWithHostArgsImpl( | 588 | aclError aclrtLaunchSIMTKernelWithHostArgsImpl( |
| 589 | - void* func, dim3 gridDim, dim3 blockDim, size_t dynUbufSize, aclrtStream stream, aclrtLaunchKernelCfg* cfg, | 589 | + void* func, aclrtDim3 gridDim, aclrtDim3 blockDim, size_t dynUbufSize, aclrtStream stream, |
| 590 | - void* hostArgs, size_t argsSize, aclrtPlaceHolderInfo* placeHolderArray, size_t placeHolderNum) | 590 | + aclrtLaunchKernelCfg* cfg, void* hostArgs, size_t argsSize, aclrtPlaceHolderInfo* placeHolderArray, |
| 591 | + size_t placeHolderNum) | ||
| 591 | { | 592 | { |
| 592 | ACL_PROFILING_REG(acl::AclProfType::AclrtLaunchSIMTKernelWithHostArgs); | 593 | ACL_PROFILING_REG(acl::AclProfType::AclrtLaunchSIMTKernelWithHostArgs); |
| 593 | ACL_LOG_INFO("Start to execute aclrtLaunchSIMTKernelWithHostArgs"); | 594 | ACL_LOG_INFO("Start to execute aclrtLaunchSIMTKernelWithHostArgs"); |
| @@ -3470,8 +3470,8 @@ TEST_F(UTEST_ACL_Runtime, launch_kernel_failed_with_rt_launch_kernel_func_failed | |||
| 3470 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_nullptr) | 3470 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_nullptr) |
| 3471 | { | 3471 | { |
| 3472 | void* func = nullptr; | 3472 | void* func = nullptr; |
| 3473 | - dim3 gridDim = {1, 1, 1}; | 3473 | + aclrtDim3 gridDim = {1, 1, 1}; |
| 3474 | - dim3 blockDim = {1, 1, 1}; | 3474 | + aclrtDim3 blockDim = {1, 1, 1}; |
| 3475 | size_t dynUbufSize = 0; | 3475 | size_t dynUbufSize = 0; |
| 3476 | aclrtStream stream = nullptr; | 3476 | aclrtStream stream = nullptr; |
| 3477 | aclrtLaunchKernelCfg* cfg = nullptr; | 3477 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3484,8 +3484,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_nullptr | |||
| 3484 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_successful) | 3484 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_successful) |
| 3485 | { | 3485 | { |
| 3486 | void* func = (void*)0x01U; | 3486 | void* func = (void*)0x01U; |
| 3487 | - dim3 gridDim = {2, 2, 2}; | 3487 | + aclrtDim3 gridDim = {2, 2, 2}; |
| 3488 | - dim3 blockDim = {4, 4, 4}; | 3488 | + aclrtDim3 blockDim = {4, 4, 4}; |
| 3489 | size_t dynUbufSize = 1024; | 3489 | size_t dynUbufSize = 1024; |
| 3490 | aclrtStream stream = (aclrtStream)0x01U; | 3490 | aclrtStream stream = (aclrtStream)0x01U; |
| 3491 | aclrtLaunchKernelCfg* cfg = nullptr; | 3491 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3500,8 +3500,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_successful) | |||
| 3500 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_invalid_handle) | 3500 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_invalid_handle) |
| 3501 | { | 3501 | { |
| 3502 | void* func = (void*)0x01U; | 3502 | void* func = (void*)0x01U; |
| 3503 | - dim3 gridDim = {1, 1, 1}; | 3503 | + aclrtDim3 gridDim = {1, 1, 1}; |
| 3504 | - dim3 blockDim = {1, 1, 1}; | 3504 | + aclrtDim3 blockDim = {1, 1, 1}; |
| 3505 | size_t dynUbufSize = 0; | 3505 | size_t dynUbufSize = 0; |
| 3506 | aclrtStream stream = nullptr; | 3506 | aclrtStream stream = nullptr; |
| 3507 | aclrtLaunchKernelCfg* cfg = nullptr; | 3507 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3516,8 +3516,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_invalid | |||
| 3516 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_feature_not_support) | 3516 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_feature_not_support) |
| 3517 | { | 3517 | { |
| 3518 | void* func = (void*)0x01U; | 3518 | void* func = (void*)0x01U; |
| 3519 | - dim3 gridDim = {1, 1, 1}; | 3519 | + aclrtDim3 gridDim = {1, 1, 1}; |
| 3520 | - dim3 blockDim = {1, 1, 1}; | 3520 | + aclrtDim3 blockDim = {1, 1, 1}; |
| 3521 | size_t dynUbufSize = 0; | 3521 | size_t dynUbufSize = 0; |
| 3522 | aclrtStream stream = nullptr; | 3522 | aclrtStream stream = nullptr; |
| 3523 | aclrtLaunchKernelCfg* cfg = nullptr; | 3523 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3532,8 +3532,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_feature | |||
| 3532 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_other_error) | 3532 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_other_error) |
| 3533 | { | 3533 | { |
| 3534 | void* func = (void*)0x01U; | 3534 | void* func = (void*)0x01U; |
| 3535 | - dim3 gridDim = {1, 1, 1}; | 3535 | + aclrtDim3 gridDim = {1, 1, 1}; |
| 3536 | - dim3 blockDim = {1, 1, 1}; | 3536 | + aclrtDim3 blockDim = {1, 1, 1}; |
| 3537 | size_t dynUbufSize = 0; | 3537 | size_t dynUbufSize = 0; |
| 3538 | aclrtStream stream = nullptr; | 3538 | aclrtStream stream = nullptr; |
| 3539 | aclrtLaunchKernelCfg* cfg = nullptr; | 3539 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3548,8 +3548,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_args_array_failed_with_other_e | |||
| 3548 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_nullptr_func) | 3548 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_nullptr_func) |
| 3549 | { | 3549 | { |
| 3550 | void* func = nullptr; | 3550 | void* func = nullptr; |
| 3551 | - dim3 gridDim = {1, 1, 1}; | 3551 | + aclrtDim3 gridDim = {1, 1, 1}; |
| 3552 | - dim3 blockDim = {1, 1, 1}; | 3552 | + aclrtDim3 blockDim = {1, 1, 1}; |
| 3553 | size_t dynUbufSize = 0; | 3553 | size_t dynUbufSize = 0; |
| 3554 | aclrtStream stream = nullptr; | 3554 | aclrtStream stream = nullptr; |
| 3555 | aclrtLaunchKernelCfg* cfg = nullptr; | 3555 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3564,8 +3564,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_nullptr_ | |||
| 3564 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_nullptr_hostargs) | 3564 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_nullptr_hostargs) |
| 3565 | { | 3565 | { |
| 3566 | void* func = (void*)0x01U; | 3566 | void* func = (void*)0x01U; |
| 3567 | - dim3 gridDim = {1, 1, 1}; | 3567 | + aclrtDim3 gridDim = {1, 1, 1}; |
| 3568 | - dim3 blockDim = {1, 1, 1}; | 3568 | + aclrtDim3 blockDim = {1, 1, 1}; |
| 3569 | size_t dynUbufSize = 0; | 3569 | size_t dynUbufSize = 0; |
| 3570 | aclrtStream stream = nullptr; | 3570 | aclrtStream stream = nullptr; |
| 3571 | aclrtLaunchKernelCfg* cfg = nullptr; | 3571 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3580,8 +3580,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_nullptr_ | |||
| 3580 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_args_size_zero) | 3580 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_args_size_zero) |
| 3581 | { | 3581 | { |
| 3582 | void* func = (void*)0x01U; | 3582 | void* func = (void*)0x01U; |
| 3583 | - dim3 gridDim = {1, 1, 1}; | 3583 | + aclrtDim3 gridDim = {1, 1, 1}; |
| 3584 | - dim3 blockDim = {1, 1, 1}; | 3584 | + aclrtDim3 blockDim = {1, 1, 1}; |
| 3585 | size_t dynUbufSize = 0; | 3585 | size_t dynUbufSize = 0; |
| 3586 | aclrtStream stream = nullptr; | 3586 | aclrtStream stream = nullptr; |
| 3587 | aclrtLaunchKernelCfg* cfg = nullptr; | 3587 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3596,8 +3596,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_args_siz | |||
| 3596 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_successful) | 3596 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_successful) |
| 3597 | { | 3597 | { |
| 3598 | void* func = (void*)0x01U; | 3598 | void* func = (void*)0x01U; |
| 3599 | - dim3 gridDim = {2, 2, 2}; | 3599 | + aclrtDim3 gridDim = {2, 2, 2}; |
| 3600 | - dim3 blockDim = {4, 4, 4}; | 3600 | + aclrtDim3 blockDim = {4, 4, 4}; |
| 3601 | size_t dynUbufSize = 2048; | 3601 | size_t dynUbufSize = 2048; |
| 3602 | aclrtStream stream = (aclrtStream)0x01U; | 3602 | aclrtStream stream = (aclrtStream)0x01U; |
| 3603 | aclrtLaunchKernelCfg* cfg = nullptr; | 3603 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3614,8 +3614,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_successful) | |||
| 3614 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_invalid_handle) | 3614 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_invalid_handle) |
| 3615 | { | 3615 | { |
| 3616 | void* func = (void*)0x01U; | 3616 | void* func = (void*)0x01U; |
| 3617 | - dim3 gridDim = {1, 1, 1}; | 3617 | + aclrtDim3 gridDim = {1, 1, 1}; |
| 3618 | - dim3 blockDim = {1, 1, 1}; | 3618 | + aclrtDim3 blockDim = {1, 1, 1}; |
| 3619 | size_t dynUbufSize = 0; | 3619 | size_t dynUbufSize = 0; |
| 3620 | aclrtStream stream = nullptr; | 3620 | aclrtStream stream = nullptr; |
| 3621 | aclrtLaunchKernelCfg* cfg = nullptr; | 3621 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3632,8 +3632,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_invalid_ | |||
| 3632 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_feature_not_support) | 3632 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_feature_not_support) |
| 3633 | { | 3633 | { |
| 3634 | void* func = (void*)0x01U; | 3634 | void* func = (void*)0x01U; |
| 3635 | - dim3 gridDim = {1, 1, 1}; | 3635 | + aclrtDim3 gridDim = {1, 1, 1}; |
| 3636 | - dim3 blockDim = {1, 1, 1}; | 3636 | + aclrtDim3 blockDim = {1, 1, 1}; |
| 3637 | size_t dynUbufSize = 0; | 3637 | size_t dynUbufSize = 0; |
| 3638 | aclrtStream stream = nullptr; | 3638 | aclrtStream stream = nullptr; |
| 3639 | aclrtLaunchKernelCfg* cfg = nullptr; | 3639 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3650,8 +3650,8 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_feature_ | |||
| 3650 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_other_error) | 3650 | TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_other_error) |
| 3651 | { | 3651 | { |
| 3652 | void* func = (void*)0x01U; | 3652 | void* func = (void*)0x01U; |
| 3653 | - dim3 gridDim = {1, 1, 1}; | 3653 | + aclrtDim3 gridDim = {1, 1, 1}; |
| 3654 | - dim3 blockDim = {1, 1, 1}; | 3654 | + aclrtDim3 blockDim = {1, 1, 1}; |
| 3655 | size_t dynUbufSize = 0; | 3655 | size_t dynUbufSize = 0; |
| 3656 | aclrtStream stream = nullptr; | 3656 | aclrtStream stream = nullptr; |
| 3657 | aclrtLaunchKernelCfg* cfg = nullptr; | 3657 | aclrtLaunchKernelCfg* cfg = nullptr; |
| @@ -3665,30 +3665,6 @@ TEST_F(UTEST_ACL_Runtime, launch_simt_kernel_with_host_args_failed_with_other_er | |||
| 3665 | EXPECT_EQ(ret, ACL_ERROR_RT_PARAM_INVALID); | 3665 | EXPECT_EQ(ret, ACL_ERROR_RT_PARAM_INVALID); |
| 3666 | } | 3666 | } |
| 3667 | 3667 | ||
| 3668 | -TEST_F(UTEST_ACL_Runtime, dim3_default_constructor_initializes_to_one) | ||
| 3669 | -{ | ||
| 3670 | - dim3 d; | ||
| 3671 | - EXPECT_EQ(d.x, 1U); | ||
| 3672 | - EXPECT_EQ(d.y, 1U); | ||
| 3673 | - EXPECT_EQ(d.z, 1U); | ||
| 3674 | -} | ||
| 3675 | - | ||
| 3676 | -TEST_F(UTEST_ACL_Runtime, dim3_partial_args_constructor) | ||
| 3677 | -{ | ||
| 3678 | - dim3 d(2, 3); | ||
| 3679 | - EXPECT_EQ(d.x, 2U); | ||
| 3680 | - EXPECT_EQ(d.y, 3U); | ||
| 3681 | - EXPECT_EQ(d.z, 1U); | ||
| 3682 | -} | ||
| 3683 | - | ||
| 3684 | -TEST_F(UTEST_ACL_Runtime, dim3_full_args_constructor) | ||
| 3685 | -{ | ||
| 3686 | - dim3 d(2, 3, 4); | ||
| 3687 | - EXPECT_EQ(d.x, 2U); | ||
| 3688 | - EXPECT_EQ(d.y, 3U); | ||
| 3689 | - EXPECT_EQ(d.z, 4U); | ||
| 3690 | -} | ||
| 3691 | - | ||
| 3692 | TEST_F(UTEST_ACL_Runtime, export_to_shareablehandle_failed_with_rt_func_failed) | 3668 | TEST_F(UTEST_ACL_Runtime, export_to_shareablehandle_failed_with_rt_func_failed) |
| 3693 | { | 3669 | { |
| 3694 | aclrtDrvMemHandle handle = (aclrtDrvMemHandle)0x01U; | 3670 | aclrtDrvMemHandle handle = (aclrtDrvMemHandle)0x01U; |
🟡 Medium Priority
变更行:diff 中删除了
docs/zh/api_ref/14_kerne_loading_and_execution.md中aclrtLaunchSIMTKernelWithArgsArray和aclrtLaunchSIMTKernelWithHostArgs两个 API 的完整参考文档章节(含功能说明、参数说明、返回值说明、约束说明、参考资源),同时从文件顶部的接口列表和 Launch 接口对比表中移除了这两个 API 的条目。影响:这两个 API 仍然作为公开接口存在于
include/external/acl/acl_rt.h中(带有ACL_FUNC_VISIBILITY和 doxygen 注释),但在docs/zh/api_ref/下的接口参考文档中已无任何说明。用户查阅《核函数加载与执行》文档时将找不到这两个 API 的用法、参数约束和返回值说明,仅能依赖头文件中的简要 doxygen 注释。触发条件:用户通过文档了解 AscendCL Runtime 核函数启动 API 时,会遗漏这两个 SIMT 专用接口。
建议:如果确认这两个 SIMT API 应保留文档,则恢复其参考章节并将类型从
dim3改为aclrtDim3;如果当前有意不公开文档(例如 API 仍为实验性),则无需修改。