HcclEngineCtxGet
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
x |
|
x |
|
x |
For
Function
Obtains the corresponding communication engine context based on the communication engine context tag by specifying the communicator and communication engine.
Prototype
1 | HcclResult HcclEngineCtxGet(HcclComm comm, const char *ctxTag, CommEngine engine, void **ctx, uint64_t *size) |
Parameters
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
comm |
Input |
Communicator handle. The HcclComm type is defined as follows:
|
||
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. |
||
ctx |
Output |
Communication engine context handle. |
||
size |
Output |
Memory size corresponding to the 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 = 0; void *ctx = nullptr; string ctxTag = "ctxTag"; CommEngine engine = CommEngine::COMM_ENGINE_CPU_TS; ret = HcclEngineCtxGet(comm, ctxTag, engine, &ctx, &size); |