45 struct array_proxy_impl;
46 array_proxy_impl *impl;
51 #if __cplusplus > 199711L
58 operator array()
const;
62 array_proxy& operator OP(const array_proxy &a); \
63 array_proxy& operator OP(const array &a); \
64 array_proxy& operator OP(const double &a); \
65 array_proxy& operator OP(const cdouble &a); \
66 array_proxy& operator OP(const cfloat &a); \
67 array_proxy& operator OP(const float &a); \
68 array_proxy& operator OP(const int &a); \
69 array_proxy& operator OP(const unsigned &a); \
70 array_proxy& operator OP(const bool &a); \
71 array_proxy& operator OP(const char &a); \
72 array_proxy& operator OP(const unsigned char &a); \
73 array_proxy& operator OP(const long &a); \
74 array_proxy& operator OP(const unsigned long &a); \
75 array_proxy& operator OP(const long long &a); \
76 array_proxy& operator OP(const unsigned long long &a); \
88 dim_t elements()
const;
89 template<
typename T> T* host()
const;
90 void host(
void *ptr)
const;
93 dim_t dims(
unsigned dim)
const;
94 unsigned numdims()
const;
98 bool isscalar()
const;
99 bool isvector()
const;
101 bool iscolumn()
const;
102 bool iscomplex()
const;
103 inline bool isreal()
const {
return !iscomplex(); }
104 bool isdouble()
const;
105 bool issingle()
const;
106 bool isrealfloating()
const;
107 bool isfloating()
const;
108 bool isinteger()
const;
114 template<
typename T> T scalar()
const;
115 template<
typename T> T* device()
const;
536 dim_t elements()
const;
541 template<
typename T> T* host()
const;
546 void host(
void *ptr)
const;
551 template<
typename T>
void write(
const T *ptr,
const size_t bytes,
af::source src =
afHost);
566 dim_t dims(
unsigned dim)
const;
571 unsigned numdims()
const;
576 size_t bytes()
const;
586 bool isempty()
const;
591 bool isscalar()
const;
596 bool isvector()
const;
606 bool iscolumn()
const;
611 bool iscomplex()
const;
616 inline bool isreal()
const {
return !iscomplex(); }
621 bool isdouble()
const;
626 bool issingle()
const;
631 bool isrealfloating()
const;
636 bool isfloating()
const;
641 bool isinteger()
const;
658 template<
typename T> T scalar()
const;
674 template<
typename T> T* device()
const;
822 array& OP(const array &val); \
823 array& OP(const double &val); \
824 array& OP(const cdouble &val); \
825 array& OP(const cfloat &val); \
826 array& OP(const float &val); \
827 array& OP(const int &val); \
828 array& OP(const unsigned &val); \
829 array& OP(const bool &val); \
830 array& OP(const char &val); \
831 array& OP(const unsigned char &val); \
832 array& OP(const long &val); \
833 array& OP(const unsigned long &val); \
834 array& OP(const long long &val); \
835 array& OP(const unsigned long long &val); \
913 array operator !()
const;
919 int nonzeros()
const;
924 AFAPI array OP (const array& lhs, const array& rhs); \
925 AFAPI array OP (const bool& lhs, const array& rhs); \
926 AFAPI array OP (const int& lhs, const array& rhs); \
927 AFAPI array OP (const unsigned& lhs, const array& rhs); \
928 AFAPI array OP (const char& lhs, const array& rhs); \
929 AFAPI array OP (const unsigned char& lhs, const array& rhs); \
930 AFAPI array OP (const long& lhs, const array& rhs); \
931 AFAPI array OP (const unsigned long& lhs, const array& rhs); \
932 AFAPI array OP (const long long& lhs, const array& rhs); \
933 AFAPI array OP (const unsigned long long& lhs, const array& rhs); \
934 AFAPI array OP (const double& lhs, const array& rhs); \
935 AFAPI array OP (const float& lhs, const array& rhs); \
936 AFAPI array OP (const cfloat& lhs, const array& rhs); \
937 AFAPI array OP (const cdouble& lhs, const array& rhs); \
938 AFAPI array OP (const array& lhs, const bool& rhs); \
939 AFAPI array OP (const array& lhs, const int& rhs); \
940 AFAPI array OP (const array& lhs, const unsigned& rhs); \
941 AFAPI array OP (const array& lhs, const char& rhs); \
942 AFAPI array OP (const array& lhs, const unsigned char& rhs); \
943 AFAPI array OP (const array& lhs, const long& rhs); \
944 AFAPI array OP (const array& lhs, const unsigned long& rhs); \
945 AFAPI array OP (const array& lhs, const long long& rhs); \
946 AFAPI array OP (const array& lhs, const unsigned long long& rhs); \
947 AFAPI array OP (const array& lhs, const double& rhs); \
948 AFAPI array OP (const array& lhs, const float& rhs); \
949 AFAPI array OP (const array& lhs, const cfloat& rhs); \
950 AFAPI array OP (const array& lhs, const cdouble& rhs); \
Definition: algorithm.h:14
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:821
void eval() const
Evaluate any JIT expressions to generate data for the array.
A multi dimensional data container.
Definition: array.h:27
array & eval(array &a)
Evaluate an expression (nonblocking).
Definition: array.h:1207
Struct used while indexing af_array.
Definition: index.h:23
af_err
Definition: defines.h:58
bool isreal() const
Returns true if the array type is neither c32 nor c64.
Definition: array.h:616
af_source
Definition: defines.h:164
long long dim_t
Definition: defines.h:50
#define BIN_OP(OP)
(const array&, const array&)
Definition: array.h:924
bool isreal() const
Definition: array.h:103
Wrapper for af_index.
Definition: index.h:52
#define AFAPI
Definition: defines.h:31
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:105
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:172
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:152
Intermediate data class.
Definition: array.h:43
Host pointer.
Definition: defines.h:166
af_dtype
Definition: defines.h:151
AFAPI af_err af_eval(af_array in)
Evaluate any expressions in the Array.