HcclEngineCtxCopy

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

Copies the memory data on the host to the corresponding communication engine context by specifying the communicator, communication engine, and communication engine context tag.

Prototype

1
HcclResult HcclEngineCtxCopy(HcclComm comm, CommEngine engine, const char *ctxTag, const void *srcCtx, uint64_t size, uint64_t dstCtxOffset)

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.

ctxTag

Input

Communicator engine context tag. The maximum length is HCCL_RES_TAG_MAX_LEN.

srcCtx

Input

Source memory address.

size

Input

Source memory size.

dstCtxOffset

Input

Offset of the address copied to the communication engine context.

Returns

HcclResult: HCCL_SUCCESS on success, or else failure.

Restrictions

None

Example

1
2
3
4
5
6
7
HcclComm comm;
CommEngine engine = CommEngine::COMM_ENGINE_AICPU_TS;
string ctxTag = "ctxTag";
AlgResourceCtx* resCtx;  // Valid source CTX
uint64_t size = 16; // Actual size to be copied
uint64_t dstCtxOffset = 0; // If all data is copied, the offset is 0.
ret = HcclEngineCtxCopy(comm, engine, ctxTag, resCtx, size, dstCtxOffset);