array.h (2014-04-30 15:38:09 -0400, (build fd32605))
Go to the documentation of this file.
1 #pragma once
2 #include "defines.h"
3 
4 // HACK These are needed because Windows defines min/max as macros, which results
5 // in a compilation error when we declare our min/max functions below.
6 #undef min
7 #undef max
8 #define NOMINMAX
9 
10 namespace af {
11 // forward declare classes
12 class dim4;
13 class ginternal;
14 class array;
15 }
16 
17 #include "defines.h"
18 #include "dims.h"
19 #include "index.h"
20 #include "gfor.h"
21 
23 #define REST af_source_t src=afHost, unsigned ngfor=0
24 #define GROUP(...) __VA_ARGS__
26 
27 
28 namespace af {
390  typedef enum {
392  f32,
393  c32,
394  f64,
395  c64,
396  b8,
397  s32,
398  u32,
399  } dtype;
400 
402  typedef enum {
405  } af_source_t;
406 
407 #define afDevicePointer afDevice
408 #define afHostPointer afHost
409 
411  class AFAPI array {
412 
413  public:
424  array copy() const;
425 
426  array(ginternal*);
427  ~array(); // destroy
430 #define CONSTR(what, dims, ...) \
431  template<typename ty> array(dims, const ty __VA_ARGS__); \
432 
433 
444  array();
445 
472  array(const dim4& dims, dtype ty = f32);
473 
496  array(int d0, int d1, dtype ty = f32);
497 
521  array(int d0, int d1, int d2, dtype ty = f32);
522 
546  array(int d0, int d1, int d2, int d3, dtype ty = f32);
547 
566  array(const array&);
567 
581  array(const seq& s);
582 
613  CONSTR(column vector, unsigned dim0, *pointer, REST)
614 
615 
640  CONSTR(matrix, GROUP(unsigned dim0, unsigned dim1), *pointer, REST)
641 
666  CONSTR(volume, GROUP(unsigned dim0, unsigned dim1, unsigned dim2), *pointer, REST)
667 
692  CONSTR(4D array, GROUP(unsigned dim0, unsigned dim1, unsigned dim2, unsigned dim3), *pointer, REST)
693 
723  CONSTR(array, const dim4& dims, *pointer, REST)
724 
756  template<typename ty> static array scalar(const ty value);
762 #undef CONSTR
763 #undef REST
764 
765 
793  array(const array& input, const dim4& dims);
794 
826  array(const array& input, int dim0, int dim1 = 1, int dim2 = 1, int dim3 = 1);
827 
828 
829  // endgroup construct
831 
853  dim4 dims() const;
854 
866  int dims(unsigned dim) const;
878  int numdims() const;
899  int elements() const;
923  int nonzeros() const;
924 
941  unsigned ngfor() const;
959  size_t bytes() const;
989  bool isempty() const;
1015  bool isscalar() const;
1042  bool isvector() const;
1069  bool isrow() const;
1095  bool iscolumn() const;
1123  dtype type() const;
1152  bool iscomplex() const;
1180  inline bool isreal() const { return iscomplex() == false; }
1197  bool issparse() const;
1214  void eval();
1219 
1232  void unlock() const;
1265  array row(int index) const { return operator()(index, span, span, span); }
1296  array col(int index) const { return operator()(span, index, span, span); }
1328  array slice(int index) const { return operator()(span, span, index, span); }
1356  array rows(int first, int last) const { return operator()(seq(first, last), span, span, span); }
1384  array cols(int first, int last) const { return operator()(span, seq(first, last), span, span); }
1404  array slices(int first, int last) const { return operator()(span, span, seq(first, last), span); }
1430  array operator()(int index) const { return operator()(seq(index, index)); }
1431 
1450  array operator()(const seq& s) const;
1451 
1471  array operator()(array indices) const;
1472 
1493  array operator()(const seq& rows, const seq& cols) const;
1494 
1513  array operator()(int row, int col) const { return operator()(seq(row, row), seq(col, col)); }
1514 
1534  array operator()(int row, const seq& y) const { return operator()(seq(row, row), y); }
1535 
1547  array operator()(int row, array columns) const { return operator()(seq(row, row), columns); }
1548 
1568  array operator()(const seq& x, int column) const { return operator()(x, seq(column, column)); }
1569 
1581  array operator()(const seq& rows, array columns) const;
1582 
1591  array operator()(array rows, int column) const { return operator()(rows, seq(column, column)); }
1592 
1601  array operator()(array rows, const seq& columns) const;
1602 
1611  array operator()(array rows, array columns) const;
1612 
1622  array operator()(int x, int y, int z) const { return operator()(seq(x, x), seq(y, y), seq(z, z)); }
1623 
1633  array operator()(const seq& x, int y, int z) const { return operator()(x, seq(y, y), seq(z, z)); }
1634 
1644  array operator()(int x, const seq& y, int z) const { return operator()(seq(x, x), y, seq(z, z)); }
1645 
1655  array operator()(int x, int y, const seq& z) const { return operator()(seq(x, x), seq(y, y), z); }
1656 
1667  array operator()(int x, const seq& y, const seq& z) const { return operator()(seq(x, x), y, z); }
1668 
1679  array operator()(const seq& x, const seq& y, int z) const { return operator()(x, y, seq(z, z)); }
1680 
1691  array operator()(const seq& x, int y, const seq& z) const { return operator()(x, seq(y, y), z); }
1692 
1703  array operator()(const seq& x, const seq& y, const seq& z) const;
1704 
1714  array operator()(array rows, array cols, const seq& slices) const;
1715 
1726  array operator()(array rows, array cols, int slice) const { return operator()(rows, cols, seq(slice, slice)); }
1727 
1738  array operator()(array rows, const seq& cols, const seq& slices) const;
1739 
1750  array operator()(const seq& rows, array cols, int slice) const { return operator()(rows, cols, seq(slice, slice)); }
1751 
1762  array operator()(array rows, int cols, int slice) const { return operator()(rows, seq(cols, cols), seq(slice, slice)); }
1763 
1774  array operator()(array rows, const seq& cols, int slice) const { return operator()(rows, cols, seq(slice, slice)); }
1775 
1786  array operator()(const seq& rows, array cols, const seq& slices) const;
1787 
1797  array operator()(const seq& rows, const seq& cols, array slices) const;
1798 
1810  array operator()(const seq& w, const seq& x, const seq& y, array& z) const;
1821  array operator()(const seq& w, const seq& x, const seq& y, const seq& z) const;
1822 
1833  array operator()(const seq& w, const seq& x, const seq& y, int z) const { return operator()(w, x, y, seq(z, z)); }
1834 
1845  array operator()(const seq& w, const seq& x, int y, int z) const { return operator()(w, x, seq(y, y), seq(z, z)); }
1846 
1857  array operator()(const int w, const seq& x, const seq& y, const seq& z) const { return operator()(seq(w, w), x, y, z); }
1858 
1869  array operator()(const seq& w, const int x, const seq& y, const seq& z) const { return operator()(w, seq(x, x), y, z); }
1870 
1881  array operator()(const seq& w, const seq& x, const int y, const seq& z) const { return operator()(w, x, seq(y,y), z); }
1882 
1893  array operator()(const int w, const int x, const int y, const int z) const { return operator()(seq(w,w), seq(x,x), y, z); }
1894 
1919  template<typename T> T scalar() const;
1968  template<typename T> T* device() const;
2000  template<typename T> T* host() const;
2001 
2015  void host(void* ptr) const;
2041  template<typename T> static T* alloc(size_t elements);
2042 
2052  static void *alloc(size_t elements, dtype type);
2079  template<typename T> static T* pinned(size_t elements);
2089  static void free(const void*);
2094 #define SELF(op) \
2096  array& operator op(const array&); \
2097  array& operator op(const double&); \
2098  array& operator op(const cfloat&); \
2099  array& operator op(const cdouble&)
2100 
2102 #define BIN(op) \
2103  array operator op(const array&) const; \
2104  array operator op(const double&) const; \
2105  array operator op(const cfloat&) const; \
2106  array operator op(const cdouble&) const; \
2107  AFAPI friend array operator op(const double&, const array&); \
2108  AFAPI friend array operator op(const cfloat&, const array&); \
2109  AFAPI friend array operator op(const cdouble&, const array&)
2110 
2111 
2113 #define LOGIC(op) \
2114  array operator op(const array&) const; \
2115  array operator op##op(const array&) const; \
2116  array operator op##op(const bool&) const; \
2117  array operator op##op(const int&) const; \
2118  array operator op##op(const unsigned&) const; \
2119  array operator op##op(const double&) const; \
2120  array operator op##op(const cfloat&) const; \
2121  array operator op##op(const cdouble&) const; \
2122  AFAPI friend array operator op##op(const bool&, const array&); \
2123  AFAPI friend array operator op##op(const int&, const array&); \
2124  AFAPI friend array operator op##op(const unsigned&, const array&); \
2125  AFAPI friend array operator op##op(const cfloat&, const array&); \
2126  AFAPI friend array operator op##op(const cdouble&, const array&)
2127 
2129 #define COMPARISON(op) \
2130  array operator op(const array&) const; \
2131  array operator op(const bool&) const; \
2132  array operator op(const int&) const; \
2133  array operator op(const double&) const; \
2134  array operator op(const cfloat&) const; \
2135  array operator op(const cdouble&) const; \
2136  AFAPI friend array operator op(const bool&, const array&); \
2137  AFAPI friend array operator op(const int&, const array&); \
2138  AFAPI friend array operator op(const double&, const array&); \
2139  AFAPI friend array operator op(const cfloat&, const array&); \
2140  AFAPI friend array operator op(const cdouble&, const array&)
2141 
2142 
2150  array operator-() const;
2162  array operator!() const;
2174  BIN(+);
2186  BIN(*);
2198  BIN(-);
2210  BIN( /);
2222  array operator %(const array&) const;
2223  array operator %(const double&) const;
2224  AFAPI friend array operator %(const double&, const array&);
2236  SELF( +=);
2247  SELF( -=);
2259  SELF( *=);
2270  SELF( /=);
2281  array& operator %=(const array&);
2282  array& operator %=(const double&);
2294  array& operator++();
2305  array& operator--();
2317  LOGIC(&);
2328  LOGIC( |);
2339  array operator ^(const array&) const;
2353  COMPARISON( ==);
2367  COMPARISON( !=);
2380  COMPARISON( <);
2393  COMPARISON( <=);
2405  COMPARISON( >);
2417  COMPARISON( >=);
2421 #undef COMPARISON
2422 #undef BIN
2423 #undef SELF
2424 #undef LOGIC
2425 
2443  template<typename ty> array& operator=(const ty value);
2444 
2461  array& operator=(const array& a);
2462 
2491  array T() const;
2523  array H() const;
2546  array as(dtype type) const;
2554  array asfloat() const;
2568  AFAPI friend std::ostream& operator<<(std::ostream&, const array&);
2573  // --- internals ---
2574  friend class ginternal;
2576  mutable ginternal* m_internal;
2582  unsigned m_ngfor;
2583 
2584  private:
2585  array(dtype ty, const dim4& dims, const void* pointer,
2586  af_source_t src = afHost, unsigned ngfor = 0);
2587  }; // class array
2588 
2590 #define GEN(what, ...) \
2591  \
2592  \
2593  AFAPI array constant(float,__VA_ARGS__, dtype ty=f32); \
2594  AFAPI array identity(__VA_ARGS__, dtype ty=f32); \
2595  AFAPI array randu(__VA_ARGS__, dtype ty=f32); \
2596  AFAPI array randn(__VA_ARGS__, dtype ty=f32); \
2597  AFAPI array rand(__VA_ARGS__, dtype ty=u32); \
2598 
2676  GEN(column vector, unsigned nx)
2677  GEN(matrix, unsigned nx, unsigned ny)
2678  GEN(volume, unsigned nx, unsigned ny, unsigned nz)
2679  GEN(4D array, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
2680  GEN(array, const dim4& dims)
2681 
2682 
2683 
2684 #undef GEN
2685 
2687 #define UNARY(fn) AFAPI array fn(const array& x);
2688 
2689 
2691 #ifdef AFCL
2692 #define STATE true
2693 #else
2694 #define STATE false
2695 #endif
2696 
2697 #define UNARY_REAL(fn) \
2698  \
2699  AFAPI array fn(const array& x, bool isreal=STATE);
2700 
2702 #define BINARY_EXTRA(fn, a, b, comment, ...) \
2703  \
2704  AFAPI array fn(const array &a, const array &b __VA_ARGS__); \
2705  \
2706  AFAPI array fn(const array &a, const double b __VA_ARGS__); \
2707  \
2708  AFAPI array fn(const double a, const array &b __VA_ARGS__)
2709 #define BINARY_NAMED(fn,a,b,comment) BINARY_EXTRA(fn,a,b,comment,) // HACK
2710 
2712 #define BINARY(fn,comment) \
2713  \
2714  AFAPI array fn(const array &, const array &); \
2715  \
2716  AFAPI array fn(const array &, const double); \
2717  \
2718  AFAPI array fn(const double, const array &)
2719 
2721 #define EXTREMUM(fn, OP) \
2722  \
2723  AFAPI array fn(const array &x, const array &y); \
2724  \
2725  AFAPI array fn(const double x, const array &y)
2726 
2727 
2728 
2729 
2735  UNARY(sin)
2745  UNARY(sinh)
2755  UNARY(asin);
2765  UNARY(asinh);
2775  UNARY(cos);
2785  UNARY(cosh);
2795  UNARY(acos);
2805  UNARY(acosh);
2815  UNARY(tan);
2816 
2826  UNARY(tanh);
2827 
2837  UNARY(atan);
2838 
2848  UNARY(atanh);
2849 
2859  UNARY(isFinite);
2860 
2870  UNARY(isInf);
2871 
2881  UNARY(isNaN);
2882 
2892  UNARY(sign);
2902  UNARY_REAL(sqrt)
2912  BINARY_NAMED(root, radicand, n, Calculate \p n - th root of real - valued \p radicand);
2922  UNARY(pow2);
2932  BINARY_EXTRA(pow, base, power, \p base raised to \p power(exponent). If \p isreal is true then bypass checks for complexity(faster)., , bool isreal = false); // HACK
2943  UNARY(ceil);
2954  UNARY(floor);
2955 
2965  UNARY(round);
2966 
2976  UNARY(trunc);
2977 
2987  UNARY(factorial);
2988 
2998  EXTREMUM(min, Minimum);
3009  EXTREMUM(max, Maximum);
3019  UNARY_REAL(log)
3029  UNARY(log2);
3039  UNARY(log10);
3040 
3050  UNARY(log1p);
3051 
3061  UNARY(exp);
3071  UNARY(expm1);
3081  UNARY(gamma);
3091  UNARY(gammaln);
3092 
3102  UNARY(epsilon);
3103 
3113  UNARY(erf);
3114 
3124  UNARY(erfc);
3125 
3135  UNARY(erfinv);
3136 
3146  UNARY(erfcinv);
3147 
3157  UNARY(abs);
3158 
3168  UNARY(arg);
3169 
3179  UNARY(conjg);
3180 
3190  UNARY(real);
3191 
3201  UNARY(imag);
3202 
3212  UNARY(complex);
3213 
3214  BINARY_NAMED(complex, real, imaginary, Form a complex result from \p real and \p imaginary parts);
3224  BINARY(atan2, arc tangent function of two variables);
3234  BINARY(hypot, Euclidean distance function without undue overflow or underflow during intermediate steps);
3244  BINARY(rem, remainder);
3254  BINARY_NAMED(mod, x, y, Compute <tt>x - n * y</tt> where \c n is quotient of <tt>x / y</tt>. Round toward zero.);
3271  AFAPI array lower(const array& input, int diagonal = 0);
3287  AFAPI array upper(const array& input, int diagonal = 0);
3302  AFAPI array diag(const array& input);
3337  AFAPI array join(int dim, const array& A, const array& B);
3338  AFAPI array join(int dim, const array& A, const array& B, const array& C);
3339  AFAPI array join(int dim, const array& A, const array& B, const array& C, const array& D);
3371  AFAPI array flip(const array& in, unsigned dim);
3376 #undef CONSTRUCTOR
3377 #undef REAL_CONSTRUCTOR
3378 #undef ROOT_CONSTRUCTOR
3379 #undef GENERATOR
3380 #undef UNARY_OPERATION
3381 #undef BINARY_OPERATION
3382 #undef UNARY
3383 #undef UNARY_REAL
3384 #undef BINARY
3385 #undef BINARY_NAMED
3386 #undef BINARY_EXTRA
3387 #undef EXTREMUM
3388 #undef OPERATOR
3389 #undef COMPARISON
3390 #undef INDEX
3391 #undef ALLOC
3392 #undef DATA
3393 #undef GROUP
3394 
3395 
3401  AFAPI void sync();
3412  inline array eval(array a) { a.eval(); return a; }
3414  inline void eval(array a, array b) { eval(a); b.eval(); }
3415  inline void eval(array a, array b, array c) { eval(a, b); c.eval(); }
3416  inline void eval(array a, array b, array c, array d) { eval(a, b, c); d.eval(); }
3417  inline void eval(array a, array b, array c, array d, array e) { eval(a, b, c, d); e.eval(); }
3418  inline void eval(array a, array b, array c, array d, array e, array f) { eval(a, b, c, d, e); f.eval(); }
3423 }; // namespace af
array operator()(const seq &w, const int x, const seq &y, const seq &z) const
Access volume.
Definition: array.h:1869
array complex(const array &x)
dtype m_type
Data type.
Definition: array.h:2580
#define REST
Definition: array.h:23
#define GEN(what,...)
Definition: array.h:2590
array operator()(const seq &x, int column) const
Access linear sequence of elements at location row and column.
Definition: array.h:1568
array operator()(const seq &w, const seq &x, const int y, const seq &z) const
Access volume.
Definition: array.h:1881
array operator()(const seq &x, int y, const seq &z) const
Access elements at sequence of rows x, column y, and sequence of slices z.
Definition: array.h:1691
#define CONSTR(what, dims,...)
Create what from pointer (column-major order like Fortran)
Definition: array.h:430
handle volume(const af::array &X)
array operator()(int x, int y, const seq &z) const
Access elements at row x, column y, and sequence of slices z.
Definition: array.h:1655
array cosh(const array &x)
array pow2(const array &x)
array operator()(const seq &w, const seq &x, const seq &y, int z) const
Access volume.
Definition: array.h:1833
floating point (32-bit single-precision)
Definition: array.h:392
array mod(const array &x, const array &y)
Compute x - n * y where n is quotient of x / y.
array diag(const array &input)
Extract or form diagonal matrix.
array sign(const array &x)
#define BINARY_NAMED(fn, a, b, comment)
Definition: array.h:2709
#define UNARY_REAL(fn)
Definition: array.h:2697
array operator()(int index) const
Access linear element at index.
Definition: array.h:1430
array exp(const array &x)
array where(const array &input)
Indices where nonzero (zero-based indexing).
array isInf(const array &x)
array sqrt(const array &x, bool isreal=false)
Assume output will be real if isreal==true (faster), otherwise produce complex values if necessary (s...
array hypot(const array &, const array &)
Euclidean distance function without undue overflow or underflow during intermediate steps...
array log1p(const array &x)
array erfc(const array &x)
#define BINARY(fn, comment)
Definition: array.h:2712
ginternal * m_internal
Pointer to internal data-structures.
Definition: array.h:2576
array col(int index) const
Access column index to form column vector.
Definition: array.h:1296
array real(const array &x)
array ceil(const array &x)
array operator()(array rows, int column) const
Access elements along index array rows and location column.
Definition: array.h:1591
array root(const array &radicand, const array &n)
Calculate n - th root of real - valued radicand.
array atan2(const array &, const array &)
arc tangent function of two variables
array operator()(const int w, const int x, const int y, const int z) const
Access volume.
Definition: array.h:1893
array tan(const array &x)
array upper(const array &input, int diagonal=0)
Extract upper triangular matrix.
complex-valued floating point (32-bit single-precision real and imaginary components) ...
Definition: array.h:393
array trunc(const array &x)
array rows(int first, int last) const
Access rows first through last to form a matrix (inclusive).
Definition: array.h:1356
array operator()(int x, const seq &y, const seq &z) const
Access elements at row x, sequence of columns y, and sequence of slices z.
Definition: array.h:1667
array isFinite(const array &x)
Host-memory pointer.
Definition: array.h:404
void sync()
void eval()
Evaluate all expressions associated with the variable.
array erf(const array &x)
#define UNARY(fn)
Definition: array.h:2687
GPU array container.
Definition: array.h:411
array flip(const array &in, unsigned dim)
Flip array along a given dimension (base-zero index).
array acosh(const array &x)
array erfcinv(const array &x)
array expm1(const array &x)
#define COMPARISON(op)
Definition: array.h:2129
array min(const array &x, const array &y)
Minimum between x and y at every position.
bool isreal() const
Definition: array.h:1180
signed 32-bit integer
Definition: array.h:397
array lower(const array &input, int diagonal=0)
Extract lower triangular matrix.
sequential index generator
Definition: index.h:156
af_source_t
Specify which address-space pointer belongs.
Definition: array.h:402
#define LOGIC(op)
Definition: array.h:2113
dtype
Definition: array.h:391
array floor(const array &x)
array acos(const array &x)
array join(int dim, const array &A, const array &B)
Join two arrays along dimension dim.
array operator()(const seq &x, int y, int z) const
Access elements at sequence of rows x, column y and slice z.
Definition: array.h:1633
#define BIN(op)
Definition: array.h:2102
boolean (8-bit: nonzero=true, zero=false)
Definition: array.h:396
array asinh(const array &x)
array round(const array &x)
array operator()(int row, int col) const
Access the element at location (row, col).
Definition: array.h:1513
array slices(int first, int last) const
Access slices first through last to form a matrix (inclusive)
Definition: array.h:1404
array epsilon(const array &x)
array operator()(array rows, int cols, int slice) const
Access elements at array of row indices rows, column cols, and slice.
Definition: array.h:1762
complex-valued floating point (64-bit double-precision real and imaginary components) ...
Definition: array.h:395
#define AFAPI
Definition: defines.h:45
array operator()(int x, int y, int z) const
Access elements at location row x, column y and slice z.
Definition: array.h:1622
seq span
Reference entire dimension.
array rem(const array &, const array &)
remainder
#define EXTREMUM(fn, OP)
Definition: array.h:2721
array operator()(int row, const seq &y) const
Access linear sequence of elements at location row and y seq of columns.
Definition: array.h:1534
unsigned 32-bit integer
Definition: array.h:398
array max(const array &x, const array &y)
Maximum between x and y at every position.
array arg(const array &x)
array tanh(const array &x)
array cols(int first, int last) const
Access columns first through last to form a matrix (inclusive)
Definition: array.h:1384
#define BINARY_EXTRA(fn, a, b, comment,...)
Definition: array.h:2702
array operator()(const seq &rows, array cols, int slice) const
Access elements at sequence of row indices rows, array of column indicies cols, and slice...
Definition: array.h:1750
unsigned m_ngfor
Number of gfor tiles (zero or one indicates one tile)
Definition: array.h:2582
array erfinv(const array &x)
#define SELF(op)
Definition: array.h:2095
array operator()(const seq &w, const seq &x, int y, int z) const
Access volume.
Definition: array.h:1845
#define GROUP(...)
Definition: array.h:25
array operator()(array rows, const seq &cols, int slice) const
Access elements at array of row indices rows, sequence of column indices cols, and slice...
Definition: array.h:1774
array sinh(const array &x)
array operator()(int row, array columns) const
Access linear sequence of elements at location row and columns array of indices of columns...
Definition: array.h:1547
array pow(const array &base, const array &power, bool isreal=false)
base raised to power(exponent).
array log(const array &x, bool isreal=false)
Assume output will be real if isreal==true (faster), otherwise produce complex values if necessary (s...
array operator()(int x, const seq &y, int z) const
Access elements at row x, sequence of columns y and slice z.
Definition: array.h:1644
array operator()(const int w, const seq &x, const seq &y, const seq &z) const
Access volume.
Definition: array.h:1857
array row(int index) const
Access row index to form row vector.
Definition: array.h:1265
array conjg(const array &x)
array factorial(const array &x)
array log10(const array &x)
array log2(const array &x)
array abs(const array &x)
array gamma(const array &x)
array slice(int index) const
Access slice index to form a matrix (plane of a volume, channel in an image)
Definition: array.h:1328
array gammaln(const array &x)
array dimensions descriptor
Definition: dims.h:16
array operator()(array rows, array cols, int slice) const
Access elements at array of row indices rows, array of column indices cols, and slice.
Definition: array.h:1726
floating point (64-bit double-precision)
Definition: array.h:394
array atan(const array &x)
array asin(const array &x)
array operator()(const seq &x, const seq &y, int z) const
Access elements at sequence of rows x, sequence of columns y, and slice z.
Definition: array.h:1679
array imag(const array &x)
array eval(array a)
Evaluate an expression (nonblocking).
Definition: array.h:3413
Device-memory pointer.
Definition: array.h:403
array cos(const array &x)
array atanh(const array &x)
array isNaN(const array &x)
dim4 m_dims
Dimensions.
Definition: array.h:2578
array sin(const array &x)