HcclEngineCtxCopy
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
x |
|
x |
|
x |
For
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:
|
||
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); |