backend.h Source File

backend.h
Go to the documentation of this file.
1 /*******************************************************
2 * Copyright (c) 2014, ArrayFire
3 * All rights reserved.
4 *
5 * This file is distributed under 3-clause BSD license.
6 * The complete license agreement can be obtained at:
7 * http://arrayfire.com/licenses/BSD-3-Clause
8 ********************************************************/
9
10 #pragma once
11 #include <af/defines.h>
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 #if AF_API_VERSION >= 32
18
24 AFAPI af_err af_set_backend(const af_backend bknd);
25 #endif
26
27 #if AF_API_VERSION >= 32
28
34 AFAPI af_err af_get_backend_count(unsigned* num_backends);
35 #endif
36
37 #if AF_API_VERSION >= 32
38
44 AFAPI af_err af_get_available_backends(int* backends);
45 #endif
46
47 #if AF_API_VERSION >= 32
48
55 AFAPI af_err af_get_backend_id(af_backend *backend, const af_array in);
56 #endif
57
58 #if AF_API_VERSION >= 33
59
66 AFAPI af_err af_get_active_backend(af_backend *backend);
67 #endif
68
69 #if AF_API_VERSION >= 33
70
77 AFAPI af_err af_get_device_id(int *device, const af_array in);
78 #endif
79
80
81 #ifdef __cplusplus
82 }
83 #endif
84
85 #ifdef __cplusplus
86 namespace af
87 {
88 class array;
89
90 #if AF_API_VERSION >= 32
91
96 AFAPI void setBackend(const Backend bknd);
97 #endif
98
99 #if AF_API_VERSION >= 32
100
105 AFAPI unsigned getBackendCount();
106 #endif
107
108 #if AF_API_VERSION >= 32
109
114 AFAPI int getAvailableBackends();
115 #endif
116
117 #if AF_API_VERSION >= 32
118
124 AFAPI af::Backend getBackendId(const array &in);
125 #endif
126
127 #if AF_API_VERSION >= 33
128
133 AFAPI af::Backend getActiveBackend();
134 #endif
135
136 #if AF_API_VERSION >= 33
137
145 AFAPI int getDeviceId(const array &in);
146 #endif
147
148 }
149 #endif
af_backend
af_backend
Definition: defines.h:385
af::setBackend
AFAPI void setBackend(const Backend bknd)
af
Definition: algorithm.h:14
af_get_active_backend
AFAPI af_err af_get_active_backend(af_backend *backend)
af_set_backend
AFAPI af_err af_set_backend(const af_backend bknd)
af::Backend
af_backend Backend
Definition: defines.h:489
af::getActiveBackend
AFAPI af::Backend getActiveBackend()
af_get_available_backends
AFAPI af_err af_get_available_backends(int *backends)
af::getBackendId
AFAPI af::Backend getBackendId(const array &in)
af_err
af_err
Definition: defines.h:63
af::getAvailableBackends
AFAPI int getAvailableBackends()
defines.h
af::getDeviceId
AFAPI int getDeviceId(const array &in)
af::getBackendCount
AFAPI unsigned getBackendCount()
AFAPI
#define AFAPI
Definition: defines.h:31
afcl::array
static af::array array(af::dim4 idims, cl_mem buf, af::dtype type, bool retain=false)
Create an af::array object from an OpenCL cl_mem buffer.
Definition: opencl.h:327
af_get_backend_id
AFAPI af_err af_get_backend_id(af_backend *backend, const af_array in)
af_array
void * af_array
Definition: defines.h:222
af_get_backend_count
AFAPI af_err af_get_backend_count(unsigned *num_backends)
af_get_device_id
AFAPI af_err af_get_device_id(int *device, const af_array in)