A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
pinned
ArrayFire Functions | ArrayFire Functions by Category » Functions to create and modify Arrays » Managing devices in ArrayFire

Allocate pinned memory using ArrayFire's memory manager. More...

## Functions
AFAPI af_err | af_alloc_pinned (void **ptr, const dim_t bytes)
AFAPI void * | pinned (const size_t elements, const dtype type)
| Allocate pinned memory using ArrayFire's memory manager.
template<typename T >
T * | pinned (const size_t elements)
| Allocate pinned memory using ArrayFire's memory manager.

## Detailed Description

Allocate pinned memory using ArrayFire's memory manager.

These functions allocate page locked memory. This type of memory has better performance characteristics but require additional care because they are a limited resource.

## Function Documentation

## ◆ af_alloc_pinned()

AFAPI af_err af_alloc_pinned | ( | void ** | ptr,
|  | const dim_t | bytes )

## ◆ pinned() [1/2]

template<typename T >

T * pinned | ( | const size_t | elements | ) |

Allocate pinned memory using ArrayFire's memory manager.

These functions allocate page locked memory. This type of memory has better performance characteristics but require additional care because they are a limited resource.

Parameters

  [in] | elements | the number of elements to allocate

Returns
  the pointer to the memory

## ◆ pinned() [2/2]

AFAPI void * pinned | ( | const size_t | elements,
|  | const dtype | type )

Allocate pinned memory using ArrayFire's memory manager.

These functions allocate page locked memory. This type of memory has better performance characteristics but require additional care because they are a limited resource.

Parameters

  [in] | elements | the number of elements to allocate
  [in] | type | is the type of the elements to allocate

Returns
  the pointer to the memory