File: backend.dox

package info (click to toggle)
arrayfire 3.3.2%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 109,016 kB
  • sloc: cpp: 127,909; lisp: 6,878; python: 3,923; ansic: 1,051; sh: 347; makefile: 338; xml: 175
file content (93 lines) | stat: -rw-r--r-- 2,479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
\addtogroup arrayfire_func
@{

\defgroup unified_func_setbackend setBackend

\brief Set the current backend when using Unified backend

This is a noop when using one of CPU, CUDA, or OpenCL backend.

However, when using on of those 3 but trying to set it to a different backend
will return in an exception.

\ingroup unified_func
\ingroup arrayfire_func

=======================================================================

\defgroup unified_func_getbackendcount getBackendCount

\brief Get the number of backends whose libraries were successfully loaded.

This will be between 0-3. 0 Being no backends were loaded and 3 being all
backends loaded successfully.

\ingroup unified_func
\ingroup arrayfire_func

=======================================================================

\defgroup unified_func_getavailbackends getAvailableBackends

\brief 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
\code
int backends = af::getAvailableBackends();

bool cpu    = backends & AF_BACKEND_CPU;
bool cuda   = backends & AF_BACKEND_CUDA;
bool opencl = backends & AF_BACKEND_OPENCL;
\endcode

\ingroup unified_func
\ingroup arrayfire_func

=======================================================================

\defgroup unified_func_getbackendid getBackendId

\brief Get's the backend enum for an array

This will return one of the values from the \ref af_backend enum.
The return value specifies which backend the array was created on.

\ingroup unified_func
\ingroup arrayfire_func

=======================================================================

\defgroup unified_func_getactivebackend getActiveBackend

\brief Get's the backend enum for the active backend

\ingroup unified_func
\ingroup arrayfire_func

=======================================================================

\defgroup unified_func_getdeviceid getDeviceId

\brief Get's the id of the device an array was created on.

\ingroup unified_func
\ingroup arrayfire_func

=======================================================================

@}
*/