Native alloc, native free, get device id, etc. More...
Functions | |
| AFAPI af_err | af_memory_manager_get_active_device_id (af_memory_manager handle, int *id) |
| Gets the id of the currently-active device. | |
| AFAPI af_err | af_memory_manager_native_alloc (af_memory_manager handle, void **ptr, size_t size) |
| Allocates memory with a native memory function for the active backend. | |
| AFAPI af_err | af_memory_manager_native_free (af_memory_manager handle, void *ptr) |
| Frees a pointer with a native memory function for the active backend. | |
| AFAPI af_err | af_memory_manager_get_max_memory_size (af_memory_manager handle, size_t *size, int id) |
| Gets the maximum memory size for a managed device. | |
| AFAPI af_err | af_memory_manager_get_memory_pressure_threshold (af_memory_manager handle, float *value) |
| Gets the memory pressure threshold for a memory manager. | |
| AFAPI af_err | af_memory_manager_set_memory_pressure_threshold (af_memory_manager handle, float value) |
| Sets the memory pressure threshold for a memory manager. | |
Native alloc, native free, get device id, etc.
| AFAPI af_err af_memory_manager_get_active_device_id | ( | af_memory_manager | handle, |
| int * | id ) |
Gets the id of the currently-active device.
| [in] | handle | the af_memory_manager handle |
| [out] | id | the id of the active device |
| AFAPI af_err af_memory_manager_get_max_memory_size | ( | af_memory_manager | handle, |
| size_t * | size, | ||
| int | id ) |
Gets the maximum memory size for a managed device.
| [in] | handle | the af_memory_manager handle |
| [out] | size | the max memory size for the device |
| [in] | id | the device id |
| AFAPI af_err af_memory_manager_get_memory_pressure_threshold | ( | af_memory_manager | handle, |
| float * | value ) |
Gets the memory pressure threshold for a memory manager.
| [in] | handle | the af_memory_manager handle |
| [out] | value | the memory pressure threshold |
| AFAPI af_err af_memory_manager_native_alloc | ( | af_memory_manager | handle, |
| void ** | ptr, | ||
| size_t | size ) |
Allocates memory with a native memory function for the active backend.
| [in] | handle | the af_memory_manager handle |
| [out] | ptr | the pointer to the allocated buffer (for the CUDA and CPU backends). For the OpenCL backend, this is a pointer to a cl_mem, which can be cast accordingly |
| [in] | size | the size of the pointer allocation |
| AFAPI af_err af_memory_manager_native_free | ( | af_memory_manager | handle, |
| void * | ptr ) |
Frees a pointer with a native memory function for the active backend.
| [in] | handle | the af_memory_manager handle |
| [in] | ptr | the pointer to free |
| AFAPI af_err af_memory_manager_set_memory_pressure_threshold | ( | af_memory_manager | handle, |
| float | value ) |
Sets the memory pressure threshold for a memory manager.
The memory pressure threshold determines when the JIT tree evaluates based on how much memory usage there is. If the value returned by af_memory_manager_get_memory_pressure_fn exceeds the memory pressure threshold, the JIT will evaluate a subtree if generated kernels are valid.
| [in] | handle | the af_memory_manager handle |
| [in] | value | the new threshold value |