HcclThreadAcquireWithStream
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
x |
|
x |
|
x |
For
Function
Obtains the communication thread resource of the specified notifyNum based on the existing runtime stream.
Currently, it is applicable to the scenario where the communication engine is HOST CPU+TS or CCU.
Prototype
1 | HcclResult HcclThreadAcquireWithStream(HcclComm comm, CommEngine engine, aclrtStream stream, uint32_t notifyNum, ThreadHandle *thread) |
Parameters
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
comm |
Input |
Communicator handle. The HcclComm type is defined as follows:
|
||
engine |
Input |
Communication engine type. For the definition of the CommEngine type, see CommEngine. |
||
stream |
Input |
Stream handle. |
||
notifyNum |
Input |
Number of synchronization signals. |
||
thread |
Output |
Thread handle. For the definition of the ThreadHandle type, see ThreadHandle. |
Returns
HcclResult: HCCL_SUCCESS on success, or else failure.
Restrictions
None
Example
1 2 3 4 5 6 7 8 9 10 | HcclComm comm; CommEngine engine = COMM_ENGINE_CPU_TS ; aclrtStream stream; aclrtCreateStream(&stream); ThreadHandle thread; HcclResult result = HcclThreadAcquireWithStream(comm, engine, stream, 2, &thread); // Data plane operations // ... // Stream synchronization aclrtSynchronizeStream(stream); |