HcclThreadAcquireWithStream

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

For Atlas A2 training product/Atlas A2 inference product, only the Atlas 800T A2 training server, Atlas 900 A2 PoD cluster basic unit, and Atlas 200T A2 Box16 heterogeneous subrack are supported.

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:

1
typedef void *HcclComm;

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);