mstxMemRegionsRegister
| Product | Supported |
|---|---|
| Ascend 910_95 AI Processors | √ |
| Atlas A3 training products/Atlas A3 inference products | √ |
| Atlas A2 training products/Atlas A2 inference products | √ |
| Atlas 200I/500 A2 inference products | √ |
| Atlas inference products | √ |
| Atlas training products | √ |
Registers memory pool secondary allocation. The user must ensure that the memory registered by RegionsRegister is within the range registered by mstxMemHeapRegister; otherwise, the tool will report an out-of-bounds read/write.
void mstxMemRegionsRegister(mstxDomainHandle_t domain, mstxMemRegionsRegisterBatch_t const *desc)
Table 1 Parameter description
Either globalDomain or the handle returned by mstxDomainCreateA. |
||
Description information of the memory region to be sub-allocated from the memory pool. Cannot be null. struct mstxMemRegion_st; typedef struct mstxMemRegion_st mstxMemRegion_t; typedef mstxMemRegion_t* mstxMemRegionHandle_t; typedef struct mstxMemRegionsRegisterBatch_t { mstxMemHeapHandle_t heap; // Handle of the memory pool for sub-allocation mstxMemType regionType; // Memory type of the memory region size_t regionCount; // Number of memory regions void const *regionDescArray; // Memory region description data mstxMemRegionHandle_t* regionHandleArrayOut; // Returned handle array obtained from registering sub-allocation } mstxMemRegionsRegisterBatch_t; |
None
mstxMemRegionsRegisterBatch_t regionsDesc{};
regionsDesc.heap = memPool;
regionsDesc.regionType = MSTX_MEM_TYPE_VIRTUAL_ADDRESS;
regionsDesc.regionCount = 1;
regionsDesc.regionDescArray = rangesDesc;
regionsDesc.regionHandleArrayOut = regionHandles;
mstxMemRegionsRegister(globalDomain, regionsDesc); // Secondary allocation registrationry Allocation Registration