DeviceFreeFuncHookReg
Function Usage
Registers the API for customized memory management (device memory release). This API and DeviceMallocFuncHookReg 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 DeviceFreeFuncHookReg(g_deviceFreeFuncType pFun); |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
pFun |
Input |
Function type for device memory release. The input function must be of the same type as the following function: APP_ERROR (*)(void*); The input parameters are as follows: dev_ptr: pointer to the memory to release. |
Response Parameters
Data Structure |
Description |
|---|---|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |
Parent topic: Customized Memory Resource Pool Management