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