getAvailableBackends

Functions
getAvailableBackends
Complete List of ArrayFire Functions ArrayFire Functions by Category » | Unified API Functions

Returns an integer indicating the backends loaded successfully. More...

## Functions
AFAPI af_err | af_get_available_backends (int *backends)
AFAPI int | getAvailableBackends ()

## Detailed Description

Returns an integer indicating the backends loaded successfully.

The number returned denotes the backends available according to the table:

Return Value | Backends Available
--- | ---
0 | None
1 | CPU
2 | CUDA
3 | CPU and CUDA
4 | OpenCL
5 | CPU and OpenCL
6 | CUDA and OpenCL
7 | CPU, CUDA and OpenCL

To convert the integer back into bools for each device, use the following code

int backends = af::getAvailableBackends();
bool cpu = backends & AF_BACKEND_CPU;
bool cuda = backends & AF_BACKEND_CUDA;
bool opencl = backends & AF_BACKEND_OPENCL;

## Function Documentation

## ◆ af_get_available_backends()

AFAPI af_err af_get_available_backends | ( | int * | backends | ) |

Parameters

  [out] | backends | is the OR sum of the backends available.

Returns
  af_err error code

## ◆ getAvailableBackends()

AFAPI int af::getAvailableBackends | ( |  | ) |

Returns
  OR sum of the backends available