HcclEngineCtxCreate

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

Creates the corresponding communication engine context with a specified tag by specifying the communicator and communication engine.

A communication engine context is a memory block that can be used by the data plane of the communication engine. It is used to store information such as resource handles or parameters required for operator execution. After being created, the context can be repeatedly obtained and used. The communicator and communication engine type need to be specified. A communication engine tag can index a communication engine context.

Prototype

1
HcclResult HcclEngineCtxCreate(HcclComm comm, const char *ctxTag, CommEngine engine, uint64_t size, void **ctx)

Parameters

Parameter

Input/Output

Description

comm

Input

Communicator handle.

The HcclComm type is defined as follows:

1
typedef void *HcclComm;

ctxTag

Input

Communicator engine context tag. The maximum length is HCCL_OP_TAG_LEN_MAX.

const uint32_t HCCL_OP_TAG_LEN_MAX = 255;

engine

Input

Communication engine type.

For the definition of CommEngine, see CommEngine.

size

Input

CTX memory size.

ctx

Output

Communication engine context.

Returns

HcclResult: HCCL_SUCCESS on success, or else failure.

Restrictions

None

Example

1
2
3
4
5
6
HcclComm comm;
uint64_t size = 16;
void *ctx = nullptr;
string ctxTag = "ctxTag";
CommEngine engine = CommEngine::COMM_ENGINE_CPU_TS;
HcclResult ret = HcclEngineCtxCreate(comm, ctxTag, engine, size, &ctx);