Native alloc, native free, get device id, etc.
More...
Native alloc, native free, get device id, etc.
◆ af_memory_manager_get_active_device_id()
Gets the id of the currently-active device.
- Parameters
-
- Returns
- AF_SUCCESS
◆ af_memory_manager_get_max_memory_size()
Gets the maximum memory size for a managed device.
- Parameters
-
[in] | handle | the af_memory_manager handle |
[out] | size | the max memory size for the device |
[in] | id | the device id |
- Returns
- AF_SUCCESS
◆ af_memory_manager_get_memory_pressure_threshold()
Gets the memory pressure threshold for a memory manager.
- Parameters
-
- Returns
- AF_SUCCESS
◆ af_memory_manager_native_alloc()
Allocates memory with a native memory function for the active backend.
- Parameters
-
[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 |
- Returns
- AF_SUCCESS
◆ af_memory_manager_native_free()
Frees a pointer with a native memory function for the active backend.
- Parameters
-
- Returns
- AF_SUCCESS
◆ af_memory_manager_set_memory_pressure_threshold()
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.
- Parameters
-
- Returns
- AF_SUCCESS