- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Namespaces | Functions
device.h File Reference
`#include <af/defines.h>`

Go to the source code of this file.

## Namespaces
| af

## Functions
AFAPI void | info ()
AFAPI void | deviceInfo (char *d_name, char *d_platform, char *d_toolkit, char *d_compute)
AFAPI int | getDeviceCount ()
| Gets the number of devices. More...
AFAPI int | getDevice ()
| Gets the current device ID. More...
AFAPI bool | isDoubleAvailable (const int device)
| Queries the current device for double precision floating point support. More...
AFAPI void | setDevice (const int device)
| Sets the current device. More...
AFAPI void | sync (const int device=-1)
| Blocks until the `device` is finished processing. More...
AFAPI void | setMemStepSize (const size_t size)
| Set the resolution of memory chunks. More...
AFAPI size_t | getMemStepSize ()
| Get the resolution of memory chunks. More...
AFAPI af_err | af_info ()
AFAPI af_err | af_init ()
AFAPI af_err | af_device_info (char *d_name, char *d_platform, char *d_toolkit, char *d_compute)
AFAPI af_err | af_get_device_count (int *num_of_devices)
AFAPI af_err | af_get_dbl_support (bool *available, const int device)
AFAPI af_err | af_set_device (const int device)
AFAPI af_err | af_get_device (int *device)
AFAPI af_err | af_sync (const int device)
AFAPI af_err | af_alloc_device (void **ptr, const dim_t bytes)
AFAPI af_err | af_alloc_pinned (void **ptr, const dim_t bytes)
AFAPI af_err | af_free_device (void *ptr)
AFAPI af_err | af_free_pinned (void *ptr)
AFAPI af_err | af_device_array (af_array *arr, const void *data, const unsigned ndims, const dim_t *const dims, const af_dtype type)
| Create array from device memory. More...
AFAPI af_err | af_device_mem_info (size_t *alloc_bytes, size_t *alloc_buffers, size_t *lock_bytes, size_t *lock_buffers)
| Get memory information from the memory manager. More...
AFAPI af_err | af_device_gc ()
| Call the garbage collection routine. More...
AFAPI af_err | af_set_mem_step_size (const size_t step_bytes)
| Set the minimum memory chunk size. More...
AFAPI af_err | af_get_mem_step_size (size_t *step_bytes)
| Get the minimum memory chunk size. More...
AFAPI af_err | af_lock_device_ptr (const af_array arr)
| Lock the device buffer in the memory manager. More...
AFAPI af_err | af_unlock_device_ptr (const af_array arr)
| Unlock device buffer in the memory manager. More...
AFAPI af_err | af_get_device_ptr (void **ptr, const af_array arr)
| Get the device pointer and lock the buffer in memory manager. More...
AFAPI void * | alloc (const size_t elements, const dtype type)
| Allocates memory using ArrayFire's memory manager. More...
template<typename T >
T * | alloc (const size_t elements)
| Allocates memory using ArrayFire's memory manager. More...
AFAPI void * | pinned (const size_t elements, const dtype type)
| Allocate pinned memory using ArrayFire's memory manager. More...
template<typename T >
T * | pinned (const size_t elements)
| Allocate pinned memory using ArrayFire's memory manager. More...
AFAPI void | free (const void *ptr)
| Free device memory allocated by ArrayFire's memory manager. More...
AFAPI void | freePinned (const void *ptr)
| Free device memory allocated by ArrayFire's memory manager. More...
AFAPI void | deviceMemInfo (size_t *alloc_bytes, size_t *alloc_buffers, size_t *lock_bytes, size_t *lock_buffers)
| Gets information about the memory manager. More...
AFAPI void | deviceGC ()
| Call the garbage collection function in the memory manager. More...

## Function Documentation

AFAPI af_err af_free_pinned | ( | void * | ptr | ) |

AFAPI af_err af_init | ( |  | ) |