array.h File Reference

(2014-04-30 15:38:09 -0400, (build fd32605))

#include "defines.h"
#include "dims.h"
#include "index.h"
#include "gfor.h"

Go to the source code of this file.

Data Structures

class  array
 GPU array container. More...
 

Namespaces

 af
 

Macros

#define NOMINMAX
 
#define REST
 
#define GROUP(...)
 
#define afDevicePointer   afDevice
 
#define afHostPointer   afHost
 
#define CONSTR(what, dims,...)   template<typename ty> array(dims, const ty __VA_ARGS__); \
 Create what from pointer (column-major order like Fortran) More...
 
#define SELF(op)
 
#define BIN(op)
 
#define LOGIC(op)
 
#define COMPARISON(op)
 
#define GEN(what,...)
 
#define UNARY(fn)
 
#define STATE
 
#define UNARY_REAL(fn)
 
#define BINARY_EXTRA(fn, a, b, comment,...)
 
#define BINARY_NAMED(fn, a, b, comment)   BINARY_EXTRA(fn,a,b,comment,)
 
#define BINARY(fn, comment)
 
#define EXTREMUM(fn, OP)
 

Enumerations

enum  dtype {
  f32, c32, f64, c64,
  b8, s32, u32
}
 
enum  af_source_t { afDevice, afHost }
 Specify which address-space pointer belongs. More...
 

Functions

Generate column vector
array constant (float, unsigned nx, dtype ty=f32)
 
array identity (unsigned nx, dtype ty=f32)
 
array randu (unsigned nx, dtype ty=f32)
 
array randn (unsigned nx, dtype ty=f32)
 
array rand (unsigned nx, dtype ty=u32)
 
Generate matrix
array constant (float, unsigned nx, unsigned ny, dtype ty=f32)
 
array identity (unsigned nx, unsigned ny, dtype ty=f32)
 
array randu (unsigned nx, unsigned ny, dtype ty=f32)
 
array randn (unsigned nx, unsigned ny, dtype ty=f32)
 
array rand (unsigned nx, unsigned ny, dtype ty=u32)
 
Generate volume
array constant (float, unsigned nx, unsigned ny, unsigned nz, dtype ty=f32)
 
array identity (unsigned nx, unsigned ny, unsigned nz, dtype ty=f32)
 
array randu (unsigned nx, unsigned ny, unsigned nz, dtype ty=f32)
 
array randn (unsigned nx, unsigned ny, unsigned nz, dtype ty=f32)
 
array rand (unsigned nx, unsigned ny, unsigned nz, dtype ty=u32)
 
Generate 4D array
array constant (float, unsigned d0, unsigned d1, unsigned d2, unsigned d3, dtype ty=f32)
 
array identity (unsigned d0, unsigned d1, unsigned d2, unsigned d3, dtype ty=f32)
 
array randu (unsigned d0, unsigned d1, unsigned d2, unsigned d3, dtype ty=f32)
 
array randn (unsigned d0, unsigned d1, unsigned d2, unsigned d3, dtype ty=f32)
 
array rand (unsigned d0, unsigned d1, unsigned d2, unsigned d3, dtype ty=u32)
 
Generate array
array constant (float, const dim4 &dims, dtype ty=f32)
 
array identity (const dim4 &dims, dtype ty=f32)
 
array randu (const dim4 &dims, dtype ty=f32)
 
array randn (const dim4 &dims, dtype ty=f32)
 
array rand (const dim4 &dims, dtype ty=u32)
 
array sin (const array &x)
 
array sinh (const array &x)
 
array asin (const array &x)
 
array asinh (const array &x)
 
array cos (const array &x)
 
array cosh (const array &x)
 
array acos (const array &x)
 
array acosh (const array &x)
 
array tan (const array &x)
 
array tanh (const array &x)
 
array atan (const array &x)
 
array atanh (const array &x)
 
array isFinite (const array &x)
 
array isInf (const array &x)
 
array isNaN (const array &x)
 
array sign (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 (slower to check) More...
 
array root (const array &radicand, const array &n)
 Calculate n - th root of real - valued radicand. More...
 
array root (const array &radicand, const double n)
 Calculate n - th root of real - valued radicand. More...
 
array root (const double radicand, const array &n)
 Calculate n - th root of real - valued radicand. More...
 
array pow2 (const array &x)
 
array pow (const array &base, const array &power, bool isreal=false)
 base raised to power(exponent). More...
 
array pow (const array &base, const double power, bool isreal=false)
 base raised to power(exponent). More...
 
array pow (const double base, const array &power, bool isreal=false)
 base raised to power(exponent). More...
 
array ceil (const array &x)
 
array floor (const array &x)
 
array round (const array &x)
 
array trunc (const array &x)
 
array factorial (const array &x)
 
array min (const array &x, const array &y)
 Minimum between x and y at every position. More...
 
array min (const double x, const array &y)
 Minimum between x and every element of y. More...
 
array max (const array &x, const array &y)
 Maximum between x and y at every position. More...
 
array max (const double x, const array &y)
 Maximum between x and every element of y. More...
 
array log (const array &x, bool isreal=false)
 Assume output will be real if isreal==true (faster), otherwise produce complex values if necessary (slower to check) More...
 
array log2 (const array &x)
 
array log10 (const array &x)
 
array log1p (const array &x)
 
array exp (const array &x)
 
array expm1 (const array &x)
 
array gamma (const array &x)
 
array gammaln (const array &x)
 
array epsilon (const array &x)
 
array erf (const array &x)
 
array erfc (const array &x)
 
array erfinv (const array &x)
 
array erfcinv (const array &x)
 
array abs (const array &x)
 
array arg (const array &x)
 
array conjg (const array &x)
 
array real (const array &x)
 
array imag (const array &x)
 
array complex (const array &x)
 
array complex (const array &real, const array &imaginary)
 Form a complex result from one real input. More...
 
array complex (const array &real, const double imaginary)
 Form a complex result from real and imaginary parts. More...
 
array complex (const double real, const array &imaginary)
 Form a complex result from real and imaginary parts. More...
 
array atan2 (const array &, const array &)
 arc tangent function of two variables More...
 
array atan2 (const array &, const double)
 arc tangent function of two variables More...
 
array atan2 (const double, const array &)
 arc tangent function of two variables More...
 
array hypot (const array &, const array &)
 Euclidean distance function without undue overflow or underflow during intermediate steps. More...
 
array hypot (const array &, const double)
 Euclidean distance function without undue overflow or underflow during intermediate steps. More...
 
array hypot (const double, const array &)
 Euclidean distance function without undue overflow or underflow during intermediate steps. More...
 
array rem (const array &, const array &)
 remainder More...
 
array rem (const array &, const double)
 remainder More...
 
array rem (const double, const array &)
 remainder More...
 
array mod (const array &x, const array &y)
 Compute x - n * y where n is quotient of x / y. More...
 
array mod (const array &x, const double y)
 Compute x - n * y where n is quotient of x / y. More...
 
array mod (const double x, const array &y)
 Compute x - n * y where n is quotient of x / y. More...
 
array lower (const array &input, int diagonal=0)
 Extract lower triangular matrix. More...
 
array upper (const array &input, int diagonal=0)
 Extract upper triangular matrix. More...
 
array diag (const array &input)
 Extract or form diagonal matrix. More...
 
array join (int dim, const array &A, const array &B)
 Join two arrays along dimension dim. More...
 
array join (int dim, const array &A, const array &B, const array &C)
 
array join (int dim, const array &A, const array &B, const array &C, const array &D)
 
array flip (const array &in, unsigned dim)
 Flip array along a given dimension (base-zero index). More...
 
void sync ()
 
array eval (array a)
 Evaluate an expression (nonblocking). More...
 
void eval (array a, array b)
 
void eval (array a, array b, array c)
 
void eval (array a, array b, array c, array d)
 
void eval (array a, array b, array c, array d, array e)
 
void eval (array a, array b, array c, array d, array e, array f)
 

Macro Definition Documentation

#define NOMINMAX
#define REST
#define GROUP (   ...)
#define afDevicePointer   afDevice
#define afHostPointer   afHost
#define CONSTR (   what,
  dims,
  ... 
)    template<typename ty> array(dims, const ty __VA_ARGS__); \

Create what from pointer (column-major order like Fortran)

#define SELF (   op)
#define BIN (   op)
#define LOGIC (   op)
#define COMPARISON (   op)
#define GEN (   what,
  ... 
)
#define UNARY (   fn)
#define STATE
#define UNARY_REAL (   fn)
Value:
\
AFAPI array fn(const array& x, bool isreal=STATE);
#define AFAPI
Definition: defines.h:45
#define STATE
Definition: array.h:2694
#define BINARY_EXTRA (   fn,
  a,
  b,
  comment,
  ... 
)
#define BINARY_NAMED (   fn,
  a,
  b,
  comment 
)    BINARY_EXTRA(fn,a,b,comment,)
#define BINARY (   fn,
  comment 
)
#define EXTREMUM (   fn,
  OP 
)