DeviceMallocFuncHookReg
Function Usage
Registers the API for customized memory management (device memory allocation). This API and DeviceFreeFuncHookReg must be used in pairs. If they are not used in pairs or only one of them is registered, the default mode is used, that is, the memory is directly allocated or released. Only Atlas inference product support this API.
For details, see Customized Memory Resource Pool Management.
Prototype
1 | APP_ERROR DeviceMallocFuncHookReg(g_deviceMallocFuncType pFun); |
Parameters
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
pFun |
Input |
Function type for device memory allocation. The input function must be of the same type as the following function:
The input parameters are as follows:
For details about the definition of the MxMemMallocPolicy structure, see MxMemMallocPolicy. |
Response Parameters
Data Structure |
Description |
|---|---|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |