HcommMemUnimport
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
Function
Disables memory import.
Prototype
1 | HcommResult HcommMemUnimport(EndpointHandle endpointHandle, const void *memDesc, uint32_t descLen) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
endpointHandle |
Input |
Endpoint handle. For details, see EndpointHandle. |
memDesc |
Input |
Pointer to the description. |
memDescLen |
Input |
Length of the description. |
Returns
HcommResult: 0 on success; else, failure.
Restrictions
None
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | // Operations on the export end. const EndpointDesc endpointDesc = { .protocol = COMM_PROTOCOL_ROCE, .commAddr = { .type = COMM_ADDR_TYPE_IP_V4, .addr = {{192, 168, 1, 100}} }, .loc = { .locType = ENDPOINT_LOC_TYPE_DEVICE, .device = { .devPhyId = 0, .superDevId = 0, .serverIdx = 0, .superPodIdx = 0 } }, .raws = {0} }; EndpointHandle endpointHandle = nullptr; HcommResult result = HcommEndpointCreate(&endpointDesc, &endpointHandle); const char *memTag = "HcclBuffer"; CommMem mem = { .type = COMM_MEM_TYPE_DEVICE, .addr = reinterpret_cast<void*>(0x1111), .size = 100 }; HcommMemHandle memHandle; result = HcommMemReg(endpointHandle, memTag, &mem, &memHandle); uint32_t* memDescLen; void* memDesc = nullptr; result = HcommMemExport(endpointHandle, memHandle, memDesc, memDescLen); // Operations on the import end. CommMem mem; result = HcommMemImport(endpointHandle, memDesc, memDescLen, &mem); result = HcommUnimport(endpointHandle, memDesc, memDescLen); |
Parent topic: Basic Resource Management