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); \
90 dim_t elements()
const;
91 template<
typename T> T* host()
const;
92 void host(
void *ptr)
const;
95 dim_t dims(
unsigned dim)
const;
96 unsigned numdims()
const;
100 bool isscalar()
const;
101 bool isvector()
const;
103 bool iscolumn()
const;
104 bool iscomplex()
const;
105 inline bool isreal()
const {
return !iscomplex(); }
106 bool isdouble()
const;
107 bool issingle()
const;
108 bool isrealfloating()
const;
109 bool isfloating()
const;
110 bool isinteger()
const;
116 template<
typename T> T scalar()
const;
117 template<
typename T> T* device()
const;
119 #if AF_API_VERSION >= 31
527 dim_t elements()
const;
532 template<
typename T> T* host()
const;
537 void host(
void *ptr)
const;
542 template<
typename T>
void write(
const T *ptr,
const size_t bytes,
af::source src =
afHost);
557 dim_t dims(
unsigned dim)
const;
562 unsigned numdims()
const;
567 size_t bytes()
const;
577 bool isempty()
const;
582 bool isscalar()
const;
587 bool isvector()
const;
597 bool iscolumn()
const;
602 bool iscomplex()
const;
607 inline bool isreal()
const {
return !iscomplex(); }
612 bool isdouble()
const;
617 bool issingle()
const;
622 bool isrealfloating()
const;
627 bool isfloating()
const;
632 bool isinteger()
const;
649 template<
typename T> T scalar()
const;
665 template<
typename T> T* device()
const;
817 array& OP(const array &val); \
818 array& OP(const double &val); \
819 array& OP(const cdouble &val); \
820 array& OP(const cfloat &val); \
821 array& OP(const float &val); \
822 array& OP(const int &val); \
823 array& OP(const unsigned &val); \
824 array& OP(const bool &val); \
825 array& OP(const char &val); \
826 array& OP(const unsigned char &val); \
827 array& OP(const long &val); \
828 array& OP(const unsigned long &val); \
829 array& OP(const long long &val); \
830 array& OP(const unsigned long long &val); \
908 array operator !()
const;
914 int nonzeros()
const;
934 AFAPI array OP (const array& lhs, const array& rhs); \
935 AFAPI array OP (const bool& lhs, const array& rhs); \
936 AFAPI array OP (const int& lhs, const array& rhs); \
937 AFAPI array OP (const unsigned& lhs, const array& rhs); \
938 AFAPI array OP (const char& lhs, const array& rhs); \
939 AFAPI array OP (const unsigned char& lhs, const array& rhs); \
940 AFAPI array OP (const long& lhs, const array& rhs); \
941 AFAPI array OP (const unsigned long& lhs, const array& rhs); \
942 AFAPI array OP (const long long& lhs, const array& rhs); \
943 AFAPI array OP (const unsigned long long& lhs, const array& rhs); \
944 AFAPI array OP (const double& lhs, const array& rhs); \
945 AFAPI array OP (const float& lhs, const array& rhs); \
946 AFAPI array OP (const cfloat& lhs, const array& rhs); \
947 AFAPI array OP (const cdouble& lhs, const array& rhs); \
948 AFAPI array OP (const array& lhs, const bool& rhs); \
949 AFAPI array OP (const array& lhs, const int& rhs); \
950 AFAPI array OP (const array& lhs, const unsigned& rhs); \
951 AFAPI array OP (const array& lhs, const char& rhs); \
952 AFAPI array OP (const array& lhs, const unsigned char& rhs); \
953 AFAPI array OP (const array& lhs, const long& rhs); \
954 AFAPI array OP (const array& lhs, const unsigned long& rhs); \
955 AFAPI array OP (const array& lhs, const long long& rhs); \
956 AFAPI array OP (const array& lhs, const unsigned long long& rhs); \
957 AFAPI array OP (const array& lhs, const double& rhs); \
958 AFAPI array OP (const array& lhs, const float& rhs); \
959 AFAPI array OP (const array& lhs, const cfloat& rhs); \
960 AFAPI array OP (const array& lhs, const cdouble& rhs); \
1270 #if AF_API_VERSION >= 31
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.
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_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:816
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:1217
Struct used while indexing af_array.
Definition: index.h:23
af_err
Definition: defines.h:67
bool isreal() const
Returns true if the array type is neither c32 nor c64.
Definition: array.h:607
af_source
Definition: defines.h:179
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:934
bool isreal() const
Definition: array.h:105
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:136
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:187
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:167
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
Host pointer.
Definition: defines.h:181
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:166
AFAPI af_err af_eval(af_array in)
Evaluate any expressions in the Array.