aclrtLaunchKernelWithHostArgs
产品支持情况
|
产品 |
是否支持 |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
功能说明
基于Host内存传递核函数入参,并启动对应算子的计算任务。异步接口。
函数原型
1
|
aclError aclrtLaunchKernelWithHostArgs(aclrtFuncHandle funcHandle, uint32_t numBlocks, aclrtStream stream, aclrtLaunchKernelCfg *cfg, void *hostArgs, size_t argsSize, aclrtPlaceHolderInfo *placeHolderArray, size_t placeHolderNum) |
参数说明
|
参数名 |
输入/输出 |
说明 |
|---|---|---|
|
funcHandle |
输入 |
核函数句柄。类型定义请参见aclrtFuncHandle。 |
|
numBlocks |
输入 |
指定核函数将会在几个核上执行。 |
|
stream |
输入 |
指定执行任务的Stream。类型定义请参见aclrtStream。 |
|
cfg |
输入 |
任务下发的配置信息。类型定义请参见aclrtLaunchKernelCfg。 不指定配置时,此处可传NULL。 |
|
hostArgs |
输入 |
存放核函数所有入参数据的Host内存地址指针。 |
|
argsSize |
输入 |
hostArgs参数值的大小,单位为Byte。 |
|
placeHolderArray |
输入 |
placeholder参数数组。类型定义请参见aclrtPlaceHolderInfo。 |
|
placeHolderNum |
输入 |
placeholder参数数组的大小。 |
返回值说明
返回0表示成功,返回其他值表示失败,请参见aclError。
参考资源
各Launch接口的功能和使用方式对比请参见参考资源。