HcclThreadAcquireWithStream
产品支持情况
|
产品 |
是否支持 |
|---|---|
|
|
√ |
|
|
√ |
|
|
☓ |
|
|
☓ |
|
|
☓ |
针对
功能说明
基于已有runtime stream获取指定notifyNum的通信线程资源。
当前适用于AI CPU+TS的场景。
函数原型
1
|
HcclResult HcclThreadAcquireWithStream(HcclComm comm, CommEngine engine, aclrtStream stream, uint32_t notifyNum, ThreadHandle *thread) |
参数说明
|
参数名 |
输入/输出 |
描述 |
||
|---|---|---|---|---|
|
comm |
输入 |
通信域句柄。 HcclComm类型的定义如下:
|
||
|
engine |
输入 |
通信引擎类型。 CommEngine类型的定义可参见CommEngine。 |
||
|
stream |
输入 |
stream句柄。 |
||
|
notifyNum |
输入 |
同步信号数量。 |
||
|
thread |
输出 |
线程句柄。 ThreadHandle类型的定义可参见ThreadHandle。 |
返回值
HcclResult:接口成功返回HCCL_SUCCESS,其他失败。
约束说明
无
调用示例
1 2 3 4 5 6 7 8 9 10 |
HcclComm comm; CommEngine engine = COMM_ENGINE_AICPU_TS ; aclrtStream stream; aclrtCreateStream(&stream); ThreadHandle thread; HcclResult result = HcclThreadAcquireWithStream(comm, engine, stream, 2, &thread); // 数据面操作 // ... // 流同步 aclrtSynchronizeStream(stream); |
父主题: 资源管理