A high-performance general-purpose compute library

Set and unset memory managers, set and get manager payloads, function setters. More...

Functions

AFAPI af_err af_create_memory_manager (af_memory_manager *out)
 Creates an af_memory_manager handle. More...
 
AFAPI af_err af_release_memory_manager (af_memory_manager handle)
 Destroys an af_memory_manager handle. More...
 
AFAPI af_err af_set_memory_manager (af_memory_manager handle)
 Sets an af_memory_manager to be the default memory manager for non-pinned memory allocations in ArrayFire. More...
 
AFAPI af_err af_set_memory_manager_pinned (af_memory_manager handle)
 Sets an af_memory_manager to be the default memory manager for pinned memory allocations in ArrayFire. More...
 
AFAPI af_err af_unset_memory_manager ()
 Reset the memory manager being used in ArrayFire to the default memory manager, shutting down the existing memory manager. More...
 
AFAPI af_err af_unset_memory_manager_pinned ()
 Reset the pinned memory manager being used in ArrayFire to the default memory manager, shutting down the existing pinned memory manager. More...
 
AFAPI af_err af_memory_manager_get_payload (af_memory_manager handle, void **payload)
 Gets the payload ptr from an af_memory_manager. More...
 
AFAPI af_err af_memory_manager_set_payload (af_memory_manager handle, void *payload)
 Sets the payload ptr from an af_memory_manager. More...
 
AFAPI af_err af_memory_manager_set_initialize_fn (af_memory_manager handle, af_memory_manager_initialize_fn fn)
 Sets an af_memory_manager_initialize_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_shutdown_fn (af_memory_manager handle, af_memory_manager_shutdown_fn fn)
 Sets an af_memory_manager_shutdown_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_alloc_fn (af_memory_manager handle, af_memory_manager_alloc_fn fn)
 Sets an af_memory_manager_alloc_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_allocated_fn (af_memory_manager handle, af_memory_manager_allocated_fn fn)
 Sets an af_memory_manager_allocated_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_unlock_fn (af_memory_manager handle, af_memory_manager_unlock_fn fn)
 Sets an af_memory_manager_unlock_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_signal_memory_cleanup_fn (af_memory_manager handle, af_memory_manager_signal_memory_cleanup_fn fn)
 Sets an af_memory_manager_signal_memory_cleanup_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_print_info_fn (af_memory_manager handle, af_memory_manager_print_info_fn fn)
 Sets an af_memory_manager_print_info_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_user_lock_fn (af_memory_manager handle, af_memory_manager_user_lock_fn fn)
 Sets an af_memory_manager_user_lock_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_user_unlock_fn (af_memory_manager handle, af_memory_manager_user_unlock_fn fn)
 Sets an af_memory_manager_user_unlock_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_is_user_locked_fn (af_memory_manager handle, af_memory_manager_is_user_locked_fn fn)
 Sets an af_memory_manager_is_user_locked_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_get_memory_pressure_fn (af_memory_manager handle, af_memory_manager_get_memory_pressure_fn fn)
 Sets an af_memory_manager_get_memory_pressure_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_jit_tree_exceeds_memory_pressure_fn (af_memory_manager handle, af_memory_manager_jit_tree_exceeds_memory_pressure_fn fn)
 Sets an af_memory_manager_jit_tree_exceeds_memory_pressure_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_add_memory_management_fn (af_memory_manager handle, af_memory_manager_add_memory_management_fn fn)
 Sets an af_memory_manager_add_memory_management_fn for a memory manager. More...
 
AFAPI af_err af_memory_manager_set_remove_memory_management_fn (af_memory_manager handle, af_memory_manager_remove_memory_management_fn fn)
 Sets an af_memory_manager_remove_memory_management_fn for a memory manager. More...
 

Detailed Description

Set and unset memory managers, set and get manager payloads, function setters.

Function Documentation

◆ af_create_memory_manager()

AFAPI af_err af_create_memory_manager ( af_memory_manager out)

Creates an af_memory_manager handle.

Creates a blank af_memory_manager with no attached function pointers.

Parameters
[out]outaf_memory_manager
Returns
AF_SUCCESS

◆ af_memory_manager_get_payload()

AFAPI af_err af_memory_manager_get_payload ( af_memory_manager  handle,
void **  payload 
)

Gets the payload ptr from an af_memory_manager.

Parameters
[in]handlethe af_memory_manager handle
[out]payloadpointer to the payload pointer
Returns
AF_SUCCESS

◆ af_memory_manager_set_add_memory_management_fn()

AFAPI af_err af_memory_manager_set_add_memory_management_fn ( af_memory_manager  handle,
af_memory_manager_add_memory_management_fn  fn 
)

Sets an af_memory_manager_add_memory_management_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_add_memory_management_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_alloc_fn()

AFAPI af_err af_memory_manager_set_alloc_fn ( af_memory_manager  handle,
af_memory_manager_alloc_fn  fn 
)

Sets an af_memory_manager_alloc_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_alloc_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_allocated_fn()

AFAPI af_err af_memory_manager_set_allocated_fn ( af_memory_manager  handle,
af_memory_manager_allocated_fn  fn 
)

Sets an af_memory_manager_allocated_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_allocated_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_get_memory_pressure_fn()

AFAPI af_err af_memory_manager_set_get_memory_pressure_fn ( af_memory_manager  handle,
af_memory_manager_get_memory_pressure_fn  fn 
)

Sets an af_memory_manager_get_memory_pressure_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_get_memory_pressure_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_initialize_fn()

AFAPI af_err af_memory_manager_set_initialize_fn ( af_memory_manager  handle,
af_memory_manager_initialize_fn  fn 
)

Sets an af_memory_manager_initialize_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_initialize_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_is_user_locked_fn()

AFAPI af_err af_memory_manager_set_is_user_locked_fn ( af_memory_manager  handle,
af_memory_manager_is_user_locked_fn  fn 
)

Sets an af_memory_manager_is_user_locked_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_is_user_locked_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_jit_tree_exceeds_memory_pressure_fn()

AFAPI af_err af_memory_manager_set_jit_tree_exceeds_memory_pressure_fn ( af_memory_manager  handle,
af_memory_manager_jit_tree_exceeds_memory_pressure_fn  fn 
)

Sets an af_memory_manager_jit_tree_exceeds_memory_pressure_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_jit_tree_exceeds_memory_pressure_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_payload()

AFAPI af_err af_memory_manager_set_payload ( af_memory_manager  handle,
void *  payload 
)

Sets the payload ptr from an af_memory_manager.

A payload can be any user defined memory associated with the memory manager and can be used to track state of the memory manager. It is not used directly by ArrayFire.

Parameters
[in]handlethe af_memory_manager handle
[out]payloadpointer to the payload pointer
Returns
AF_SUCCESS

◆ af_memory_manager_set_print_info_fn()

AFAPI af_err af_memory_manager_set_print_info_fn ( af_memory_manager  handle,
af_memory_manager_print_info_fn  fn 
)

Sets an af_memory_manager_print_info_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_print_info_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_remove_memory_management_fn()

AFAPI af_err af_memory_manager_set_remove_memory_management_fn ( af_memory_manager  handle,
af_memory_manager_remove_memory_management_fn  fn 
)

Sets an af_memory_manager_remove_memory_management_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_remove_memory_management_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_shutdown_fn()

AFAPI af_err af_memory_manager_set_shutdown_fn ( af_memory_manager  handle,
af_memory_manager_shutdown_fn  fn 
)

Sets an af_memory_manager_shutdown_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_shutdown_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_signal_memory_cleanup_fn()

AFAPI af_err af_memory_manager_set_signal_memory_cleanup_fn ( af_memory_manager  handle,
af_memory_manager_signal_memory_cleanup_fn  fn 
)

Sets an af_memory_manager_signal_memory_cleanup_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_signal_memory_cleanup_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_unlock_fn()

AFAPI af_err af_memory_manager_set_unlock_fn ( af_memory_manager  handle,
af_memory_manager_unlock_fn  fn 
)

Sets an af_memory_manager_unlock_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_unlock_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_user_lock_fn()

AFAPI af_err af_memory_manager_set_user_lock_fn ( af_memory_manager  handle,
af_memory_manager_user_lock_fn  fn 
)

Sets an af_memory_manager_user_lock_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_user_lock_fn to set
Returns
AF_SUCCESS

◆ af_memory_manager_set_user_unlock_fn()

AFAPI af_err af_memory_manager_set_user_unlock_fn ( af_memory_manager  handle,
af_memory_manager_user_unlock_fn  fn 
)

Sets an af_memory_manager_user_unlock_fn for a memory manager.

Parameters
[in]handlethe af_memory_manager handle
[in]fnthe af_memory_manager_user_unlock_fn to set
Returns
AF_SUCCESS

◆ af_release_memory_manager()

AFAPI af_err af_release_memory_manager ( af_memory_manager  handle)

Destroys an af_memory_manager handle.

Destroys a memory manager handle, does NOT call the af_memory_manager_shutdown_fn associated with the af_memory_manager.

Parameters
[in]handlethe af_memory_manager handle to be destroyed
Returns
AF_SUCCESS

◆ af_set_memory_manager()

AFAPI af_err af_set_memory_manager ( af_memory_manager  handle)

Sets an af_memory_manager to be the default memory manager for non-pinned memory allocations in ArrayFire.

Registers the given memory manager as the AF memory manager non-pinned memory allocations - does NOT shut down or release the existing memory manager or free any associated memory.

Parameters
[in]handlethe af_memory_manager handle to use
Returns
AF_SUCCESS

◆ af_set_memory_manager_pinned()

AFAPI af_err af_set_memory_manager_pinned ( af_memory_manager  handle)

Sets an af_memory_manager to be the default memory manager for pinned memory allocations in ArrayFire.

Registers the given memory manager as the AF memory manager for pinned memory allocations - does NOT shut down or release the existing memory manager or free any associated memory.

Parameters
[in]handlethe af_memory_manager handle to use
Returns
AF_SUCCESS

◆ af_unset_memory_manager()

AFAPI af_err af_unset_memory_manager ( )

Reset the memory manager being used in ArrayFire to the default memory manager, shutting down the existing memory manager.

Calls the associated af_memory_manager_shutdown_fn on the existing memory manager. If the default memory manager is set, ALL associated memory will be freed on shutdown. Custom behavior that does not free all memory can be defined for a custom memory manager as per the specific implementation of its associated af_memory_manager_shutdown_fn.

Returns
AF_SUCCESS

◆ af_unset_memory_manager_pinned()

AFAPI af_err af_unset_memory_manager_pinned ( )

Reset the pinned memory manager being used in ArrayFire to the default memory manager, shutting down the existing pinned memory manager.

Calls the associated af_memory_manager_shutdown_fn on the existing pinned memory manager. If the default memory manager is set, ALL associated pinned memory will be freed on shutdown. Custom behavior that does not free all pinned memory can be defined for a custom memory manager as per the specific implementation of its associated af_memory_manager_shutdown_fn.

Returns
AF_SUCCESS