47 struct array_proxy_impl;
48 array_proxy_impl *impl;
53 #if __cplusplus > 199711L 60 operator array()
const;
64 array_proxy& operator OP(const array_proxy &a); \ 65 array_proxy& operator OP(const array &a); \ 66 array_proxy& operator OP(const double &a); \ 67 array_proxy& operator OP(const cdouble &a); \ 68 array_proxy& operator OP(const cfloat &a); \ 69 array_proxy& operator OP(const float &a); \ 70 array_proxy& operator OP(const int &a); \ 71 array_proxy& operator OP(const unsigned &a); \ 72 array_proxy& operator OP(const bool &a); \ 73 array_proxy& operator OP(const char &a); \ 74 array_proxy& operator OP(const unsigned char &a); \ 75 array_proxy& operator OP(const long &a); \ 76 array_proxy& operator OP(const unsigned long &a); \ 77 array_proxy& operator OP(const long long &a); \ 78 array_proxy& operator OP(const unsigned long long &a); \ 87 #if AF_API_VERSION >= 32 89 array_proxy& operator OP(const short &a); \ 90 array_proxy& operator OP(const unsigned short &a); \ 103 dim_t elements()
const;
104 template<
typename T> T* host()
const;
105 void host(
void *ptr)
const;
108 dim_t dims(
unsigned dim)
const;
109 unsigned numdims()
const;
110 size_t bytes()
const;
112 bool isempty()
const;
113 bool isscalar()
const;
114 bool isvector()
const;
116 bool iscolumn()
const;
117 bool iscomplex()
const;
118 inline bool isreal()
const {
return !iscomplex(); }
119 bool isdouble()
const;
120 bool issingle()
const;
121 bool isrealfloating()
const;
122 bool isfloating()
const;
123 bool isinteger()
const;
125 #if AF_API_VERSION >= 34 126 bool issparse()
const;
132 template<
typename T> T scalar()
const;
133 template<
typename T> T* device()
const;
135 #if AF_API_VERSION >= 31 139 #if AF_API_VERSION >= 34 140 bool isLocked()
const;
547 dim_t elements()
const;
552 template<
typename T> T* host()
const;
557 void host(
void *ptr)
const;
562 template<
typename T>
void write(
const T *ptr,
const size_t bytes,
af::source src =
afHost);
577 dim_t dims(
unsigned dim)
const;
582 unsigned numdims()
const;
587 size_t bytes()
const;
597 bool isempty()
const;
602 bool isscalar()
const;
607 bool isvector()
const;
617 bool iscolumn()
const;
622 bool iscomplex()
const;
627 inline bool isreal()
const {
return !iscomplex(); }
632 bool isdouble()
const;
637 bool issingle()
const;
642 bool isrealfloating()
const;
647 bool isfloating()
const;
652 bool isinteger()
const;
659 #if AF_API_VERSION >= 34 663 bool issparse()
const;
676 template<
typename T> T scalar()
const;
694 template<
typename T> T* device()
const;
863 #define ASSIGN_(OP) \ 864 array& OP(const array &val); \ 865 array& OP(const double &val); \ 866 array& OP(const cdouble &val); \ 867 array& OP(const cfloat &val); \ 868 array& OP(const float &val); \ 869 array& OP(const int &val); \ 870 array& OP(const unsigned &val); \ 871 array& OP(const bool &val); \ 872 array& OP(const char &val); \ 873 array& OP(const unsigned char &val); \ 874 array& OP(const long &val); \ 875 array& OP(const unsigned long &val); \ 876 array& OP(const long long &val); \ 877 array& OP(const unsigned long long &val); \ 879 #if AF_API_VERSION >= 32 882 array& OP(const short &val); \ 883 array& OP(const unsigned short &val); \ 886 #define ASSIGN(OP) ASSIGN_(OP) 967 array operator !()
const;
973 int nonzeros()
const;
984 #if AF_API_VERSION >= 34 985 bool isLocked()
const;
1003 #define BIN_OP_(OP) \ 1004 AFAPI array OP (const array& lhs, const array& rhs); \ 1005 AFAPI array OP (const bool& lhs, const array& rhs); \ 1006 AFAPI array OP (const int& lhs, const array& rhs); \ 1007 AFAPI array OP (const unsigned& lhs, const array& rhs); \ 1008 AFAPI array OP (const char& lhs, const array& rhs); \ 1009 AFAPI array OP (const unsigned char& lhs, const array& rhs); \ 1010 AFAPI array OP (const long& lhs, const array& rhs); \ 1011 AFAPI array OP (const unsigned long& lhs, const array& rhs); \ 1012 AFAPI array OP (const long long& lhs, const array& rhs); \ 1013 AFAPI array OP (const unsigned long long& lhs, const array& rhs); \ 1014 AFAPI array OP (const double& lhs, const array& rhs); \ 1015 AFAPI array OP (const float& lhs, const array& rhs); \ 1016 AFAPI array OP (const cfloat& lhs, const array& rhs); \ 1017 AFAPI array OP (const cdouble& lhs, const array& rhs); \ 1018 AFAPI array OP (const array& lhs, const bool& rhs); \ 1019 AFAPI array OP (const array& lhs, const int& rhs); \ 1020 AFAPI array OP (const array& lhs, const unsigned& rhs); \ 1021 AFAPI array OP (const array& lhs, const char& rhs); \ 1022 AFAPI array OP (const array& lhs, const unsigned char& rhs); \ 1023 AFAPI array OP (const array& lhs, const long& rhs); \ 1024 AFAPI array OP (const array& lhs, const unsigned long& rhs); \ 1025 AFAPI array OP (const array& lhs, const long long& rhs); \ 1026 AFAPI array OP (const array& lhs, const unsigned long long& rhs); \ 1027 AFAPI array OP (const array& lhs, const double& rhs); \ 1028 AFAPI array OP (const array& lhs, const float& rhs); \ 1029 AFAPI array OP (const array& lhs, const cfloat& rhs); \ 1030 AFAPI array OP (const array& lhs, const cdouble& rhs); \ 1032 #if AF_API_VERSION >= 32 1033 #define BIN_OP(OP) \ 1035 AFAPI array OP (const short& lhs, const array& rhs); \ 1036 AFAPI array OP (const unsigned short& lhs, const array& rhs); \ 1037 AFAPI array OP (const array& lhs, const short& rhs); \ 1038 AFAPI array OP (const array& lhs, const unsigned short& rhs); \ 1041 #define BIN_OP(OP) BIN_OP_(OP) 1272 #if AF_API_VERSION >= 34 1281 #if AF_API_VERSION >= 34 1282 array *arrays[] = {&a, &b};
1283 return eval(2, arrays);
1291 #if AF_API_VERSION >= 34 1292 array *arrays[] = {&a, &b, &c};
1293 return eval(3, arrays);
1295 eval(a, b); c.eval();
1301 #if AF_API_VERSION >= 34 1302 array *arrays[] = {&a, &b, &c, &d};
1303 return eval(4, arrays);
1305 eval(a, b, c); d.eval();
1312 #if AF_API_VERSION >= 34 1313 array *arrays[] = {&a, &b, &c, &d, &e};
1314 return eval(5, arrays);
1316 eval(a, b, c, d); e.eval();
1322 #if AF_API_VERSION >= 34 1323 array *arrays[] = {&a, &b, &c, &d, &e, &f};
1324 return eval(6, arrays);
1326 eval(a, b, c, d, e); f.eval();
1330 #if AF_API_VERSION >= 34 1337 #if AF_API_VERSION >= 34 1419 #if AF_API_VERSION >= 31 1440 #if AF_API_VERSION >= 34 1450 #if AF_API_VERSION >= 34 1460 #if AF_API_VERSION >= 34 1654 #if AF_API_VERSION >= 34 AFAPI af_err af_set_manual_eval_flag(bool flag)
Turn the manual eval flag on or off.
AFAPI void setManualEvalFlag(bool flag)
Turn the manual eval flag on or off.
AFAPI af_err af_is_row(bool *result, const af_array arr)
Check if an array is row vector.
AFAPI af_err af_is_real(bool *result, const af_array arr)
Check if an array is real type.
bool isreal() const
Definition: array.h:118
Definition: algorithm.h:14
AFAPI af_err af_is_realfloating(bool *result, const af_array arr)
Check if an array is real floating point type.
AFAPI af_err af_copy_array(af_array *arr, const af_array in)
Deep copy an array to another.
AFAPI af_err af_is_sparse(bool *result, const af_array arr)
Check if an array is sparse.
AFAPI af_err af_eval_multiple(const int num, af_array *arrays)
Evaluate multiple arrays together.
AFAPI af_err af_get_data_ptr(void *data, const af_array arr)
Copy data from an af_array to a C pointer.
#define ASSIGN(OP)
(const array &)
Definition: array.h:896
AFAPI af_err af_is_complex(bool *result, const af_array arr)
Check if an array is complex type.
void eval() const
Evaluate any JIT expressions to generate data for the array.
A multi dimensional data container.
Definition: array.h:27
AFAPI af_err af_is_bool(bool *result, const af_array arr)
Check if an array is bool type.
AFAPI af_err af_is_double(bool *result, const af_array arr)
Check if an array is double precision type.
AFAPI af_err af_is_vector(bool *result, const af_array arr)
Check if an array is a vector.
AFAPI af_err af_is_integer(bool *result, const af_array arr)
Check if an array is integer type.
array & eval(array &a)
Evaluate an expression (nonblocking).
Definition: array.h:1308
bool isreal() const
Returns true if the array type is neither c32 nor c64.
Definition: array.h:627
Struct used while indexing af_array.
Definition: index.h:23
af_err
Definition: defines.h:63
af_source
Definition: defines.h:214
AFAPI af_err af_get_type(af_dtype *type, const af_array arr)
Gets the type of an array.
long long dim_t
Definition: defines.h:50
#define BIN_OP(OP)
(const array&, const array&)
Definition: array.h:1064
AFAPI af_err af_is_single(bool *result, const af_array arr)
Check if an array is single precision type.
AFAPI af_err af_get_dims(dim_t *d0, dim_t *d1, dim_t *d2, dim_t *d3, const af_array arr)
Gets the dimseions of an array.
Wrapper for af_index.
Definition: index.h:52
#define AFAPI
Definition: defines.h:31
AFAPI af_err af_is_scalar(bool *result, const af_array arr)
Check if an array is scalar, ie.
AFAPI af_err af_get_elements(dim_t *elems, const af_array arr)
Gets the number of elements in an array.
AFAPI void copy(array &dst, const array &src, const index &idx0, const index &idx1=span, const index &idx2=span, const index &idx3=span)
Copy the values of an input array based on index.
AFAPI af_err af_get_numdims(unsigned *result, const af_array arr)
Gets the number of dimensions of an array.
AFAPI af_err af_is_empty(bool *result, const af_array arr)
Check if an array is empty.
AFAPI af_err af_release_array(af_array arr)
Reduce the reference count of the af_array.
AFAPI af_err af_create_array(af_array *arr, const void *const data, const unsigned ndims, const dim_t *const dims, const af_dtype type)
Create an af_array handle initialized with user defined data.
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
AFAPI af_err af_is_column(bool *result, const af_array arr)
Check if an array is a column vector.
AFAPI af_err af_retain_array(af_array *out, const af_array in)
Increments an af_array reference count.
void * af_array
Definition: defines.h:222
AFAPI array operator-(const array &lhs, const array &rhs)
Subtracts two arrays or an array and a value.
AFAPI af_err af_write_array(af_array arr, const void *data, const size_t bytes, af_source src)
Copy data from a C pointer (host/device) to an existing array.
AFAPI af_err af_create_handle(af_array *arr, const unsigned ndims, const dim_t *const dims, const af_dtype type)
Create af_array handle.
32-bit floating point values
Definition: defines.h:196
AFAPI af_err af_get_data_ref_count(int *use_count, const af_array in)
Get the use count of af_array
Intermediate data class.
Definition: array.h:45
AFAPI af_err af_get_manual_eval_flag(bool *flag)
Get the manual eval flag.
AFAPI bool getManualEvalFlag()
Get the manual eval flag.
Host pointer.
Definition: defines.h:216
AFAPI af_err af_is_floating(bool *result, const af_array arr)
Check if an array is floating precision type.
af_dtype
Definition: defines.h:195
AFAPI af_err af_eval(af_array in)
Evaluate any expressions in the Array.