!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneF      !"#$%&'()*+,-./012345  !"#$%*-0       !"#$%&'()*+,-./012345non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None6789:;<=>?@ABCDEFGHI 6789=?@ACEGI6987:;<=>?@ABCDEFGHInon-portable (GHC extensions) /Scalar types supported in array computations/ Integral types: Int, Int8, Int16, Int32, Int64, Word, Word8, Word16, Word32, Word64, CShort, CUShort, CInt, CUInt, CLong, CULong, CLLong, CULLong Floating types: Float, Double, CFloat, CDouble Non-numeric types: Bool, Char, CChar, CSChar, CUChar 'Int' has the same bitwidth as in plain Haskell computations, and 'Float' and 'Double' represent IEEE single and double precision floating point numbers, respectively. experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None9Boundary condition specification for stencil operations. /use a constant value for outlying coordinates *wrap coordinates around on each dimension +mirror coordinates beyond the array extent -clamp coordinates to the extent of the array All scalar type !Bounded types "Numeric types #Non-numeric types $Floating types %Integral types J+All scalar element types implement Eq, Ord & Enum K(Bounded element types implement Bounded L$Numeric element types implement Num & Real M3Non-numeric types supported in array computations. N6Floating-point types supported in array computations. O0Integral types supported in array computations. PQRS T!U"V#W$X%YJZ[K\]L^_M`abcdNefghOijklmnopqrstuvwxyz{|}~c PQRS T!U"V#W$X%YJZ[K\]L^_M`abcdNefghOijklmnopqrstuvwxyz{|}~PSRQ T!U"V#W$X%YJ[ZK]\L_^Mdcba`NhgfeOzyxwvutsrqponmlkji{|}~non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneLGeneralised array index, which may index only in a subset of the dimensions  of a shape. Slice representation 8Class of slice representations (which are nested pairs) Index representation 8Class of index representations (which are nested pairs) /number of dimensions (>= 0); rank of the array -total number of elements in an array of this shape                  non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneGADT to reify the  class. Mutable array representation Immutable array representation >Safe combination of creating and fast freezing of array data. U !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijL !"#$%&'()*+,-./0123456789:;<=>?@Aklmnopqrstuvwxyz{|}~DEF/  !"#@?>=<;:9876543210/.-,+*)('&%$ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijnon-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None#&$Slices, aka generalised indices, as n-tuples and mappings of slice 4 indices to slices, co-slices, and slice dimensions +/Shapes and indices of multi-dimensional arrays Number of dimensions of a shape or index (>= 0). 2Total number of elements in an array of the given shape. ,Magic value identifying elements ignored in permute. %Yield the intersection of two shapes >Map a multi-dimensional index into one in a linear, row-major 4 representation of the array (first argument is the shape , second  argument is the index).  Inverse of . (Apply a boundary condition to an index. HIterate through the entire shape, applying the function; third argument G combines results and fourth is returned in case of an empty iteration 9 space; the index space is traversed in row-major order. )Convert a minpoint-maxpoint index into a shape.  Convert a shape! into a minpoint-maxpoint index. )Convert a shape to a list of dimensions. +Convert a list of dimensions into a shape. $The slice index for slice specifier 'Any sh' 60Segment descriptor (vector of segment lengths). HTo represent nested one-dimensional arrays, we use a flat array of data  values in conjunction with a segment descriptor, which stores the lengths  of the subarrays. 7#Vectors are one-dimensional arrays 8%Scalars arrays hold a single element 9/Multi-dimensional arrays for array processing. JIf device and host memory are separate, arrays will be transferred to the N device when necessary (if possible asynchronously and in parallel with other D tasks) and cached on the device if sufficient memory is available. ;KAccelerate supports as array elements only simple atomic types, and tuples L thereof. These element types are stored efficiently in memory, unpacked as ( consecutive elements without pointers. MThis class characterises the types of values that can be array elements, and 1 hence, appear in scalar Accelerate expressions. Type representation mapping We represent tuples by using '()' and '(,)' as type-level nil and snoc to  construct snoc-lists of types. <BMarker for arbitrary shapes in slice descriptors. Such arbitrary 6 shapes may include an unknown number of dimensions. << can be used in the leftmost position of a slice instead of  B, for example (Any :. _ :. _). In the following definition  <; is used to match against whatever shape the type variable  sh takes: Q repN :: (Shape sh, Elt e) => Int -> Acc (Array sh e) -> Acc (Array (sh:.Int) e) . repN n a = replicate (constant $ Any :. n) a >3Marker for entire dimensions in slice descriptors. +For example, when used in slices passed to , the  occurrences of >- indicate the dimensions into which the array's @ existing extent will be placed, rather than the new dimensions  introduced by replication. @.Increase an index rank by one dimension. The @ operator is + used to construct both values and types. B Rank-0 index Convenience functions Yield an array's shape Array indexing 1Create an array from its representation function /Creates a new, uninitialized Accelerate array. D Convert an  to an accelerated array. NWhile the type signature mentions Accelerate internals that are not exported, N in practice satisfying the type equality is straight forward. The index type  ix must be the unit type () for singleton arrays, or an Int or tuple of  Int's for multidimensional arrays. E#Convert an accelerated array to an . FMConvert a list, with elements in row-major order, into an accelerated array. G;Convert an accelerated array to a list in row-major order. "Nicely format a shape as a string &'()*+,-./0123456789:;<=>?@ABCDEFGO&'()*+,-./0123456789:;<=>?@ABCDEFGd&'()*+ ,-./0123456789:;<=>?@ABCDEFG non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneBConversion between surface n-tuples and our tuple representation. )Type-safe projection indices for tuples. ;NB: We index tuples by starting to count from the *right*! .Tuples of Arrays. Note that this carries the : class  constraint rather than ;# in the case of tuples of scalars. AWe represent tuples as heterogenous lists, typed by a type list.    non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NonePrimitive scalar operations  Primitive GPU constants  1Vanilla expression without free scalar variables  6Parametrised expression without free scalar variables  Vanilla open expression  XParametrised open expressions using de Bruijn indices for variables ranging over tuples ^ of scalars and arrays of tuples. All code, except Cond, is evaluated eagerly. N-tuples are  represented as nested pairs. TThe data type is parametrised over the surface types (not the representation type). /Vanilla function without free scalar variables 4Parametrised function without free scalar variables "Vanilla open function abstraction 'Parametrised open function abstraction GADT reifying the  class. Operations on stencils. -Closed array expression aka an array program @Collective array computations parametrised over array variables % represented with de Bruijn indices. @ Scalar functions and expressions embedded in well-formed array I computations cannot contain free scalar variable indices. The latter J cannot be bound in array computations, and hence, cannot appear in any  well-formed program. D The let-form is used to represent the sharing discovered by common J subexpression elimination as well as to control evaluation order. (We M need to hoist array expressions out of scalar expressions - they occur in 8 scalar indexing and in determining an arrays shape.) NThe data type is parameterised over the surface types (not the representation  type). `We use a non-recursive variant parametrised over the recursive closure, to facilitate attribute  calculation in the backend. @Vanilla array-computation function without free array variables EParametrised array-computation function without free array variables :Function abstraction over parametrised array computations  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN OPQ    RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN OPQ    RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'6NMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!  QPO    ihgfedcba`_^]\[ZYXWVUTSRkjsrqponmltuvw~}|{zyx non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None/. non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneJCalculate the offset coordinates for each stencil element relative to the H focal point. The coordinates are returned as a flattened list from the N bottom-left element to the top-right. This ordering matches the Var indexing  order. 0Position calculation on reified stencil values.  non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None  non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneFReplace the first variable with the given expression. The environment  shrinks. KReplace an expression that uses the top environment variable with another. 7 The result of the first is let bound into the second.  Composition of unary functions. (               non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneI1Scalar expressions for plain array computations. ]Scalar expressions to parametrise collective array operations, themselves parameterised over * the type of collective array operations. J%Array-valued collective computations >Array-valued collective computations without a recursive knot Note [Pipe and sharing recovery] " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  The  Q constructor is special. It is the only form that contains functions over array ? computations and these functions are fixed to be over vanilla J types. This enables us to C perform sharing recovery independently from the context for them. KJScalar expression inlet: make a Haskell value available for processing in " an Accelerate scalar expression. KNote that this embeds the value directly into the expression. Depending on G the backend used to execute the computation, this might not always be J desirable. For example, a backend that does external code generation may L embed this constant directly into the generated code, which means new code N will need to be generated and compiled every time the value changes. In such O cases, consider instead lifting scalar values into (singleton) arrays so that J they can be passed as an input to the computation and thus the value can 1 change without the need to generate fresh code. H!"I#$%&'()*+,-./0123456J789:;<=>?@ABCDEFGHIJKLMNOPQ RSTUVWXYZ[\]^_`abcdefghijklKmnopqrstuvwxyz{|}~H!"I#$%&'()*+,-./0123456J789:;<=>?@ABCDEFGHIJKLMNOPQ RSTUVWXYZ[\]^_`abcKmnopqrstuvwxyz{|}~wH!"I#6543210/.-,+*)('&%$J7R QPONMLKJIHGFEDCBA@?>=<;:98STUVWXYZ[\]^_`abcdefghijklKmnopqrstuvwxyz{|}~non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneZLEA limited subset of types which can be lifted, can also be unlifted. MHUnlift the outermost constructor through the surface type. This is only M possible if the constructor is fully determined by its type - i.e., it is a  singleton. NThe class of types e which can be lifted into c. O@An associated-type (i.e. a type-level function) that strips all * instances of surface type constructors c from the input type e. For example, the tuple types (Exp Int, Int) and  (Int, Exp  Int) have the same "Plain" representation. That is, the " following type equality holds: 7Plain (Exp Int, Int) ~ (Int,Int) ~ Plain (Int, Exp Int)P)Lift the given value into a surface type c --- either I for scalar  expressions or J7 for array computations. The value may already contain  subexpressions in c. aJArray inlet: makes an array available for processing using the Accelerate  language. HDepending upon the backend used to execute array computations, this may ' trigger (asynchronous) data transfer. bHScalar inlet: injects a scalar (or a tuple of scalars) into a singleton + array for use in the Accelerate language. cEReplicate an array across one or more dimensions as specified by the   generalised- array index provided as the first argument. For example, assuming arr& is a vector (one-dimensional array),  ! replicate (Z :.2 :.All :.3) arr (yields a three dimensional array, where arr is replicated twice across the 3 first and three times across the third dimension. d<Construct a new array by applying a function to each index. AFor example, the following will generate a one-dimensional array  (7#) of three floating point numbers:  ! generate (index1 3) (\_ -> 1.2) Or, equivalently:  1 generate (constant (Z :. (3::Int))) (\_ -> 1.2) :Finally, the following will create an array equivalent to '[1..10]':  generate (index1 10) $ \ ix -> # let (Z :. i) = unlift ix  in fromIntegral i e@Change the shape of an array without altering its contents. The  of 1 the source and result arrays must be identical. # precondition: size ix == size ix' fIndex an array with a  generalised array index, supplied as the C second argument. The result is a new array (possibly a singleton) % containing the selected dimensions (>s) in their entirety. This can be used to cut out% entire dimensions. The opposite of  c. For example, if mat! is a two dimensional array, the B following will select a specific row and yield a one dimensional  result:  - slice mat (constant (Z :. (2::Int) :. All)) !A fully specified index (with no >s) would return a single # element (zero dimensional array). g:Apply the given function element-wise to the given array. h]Apply the given binary function element-wise to the two arrays. The extent of the resulting D array is the intersection of the extents of the two source arrays. iIReduction of the innermost dimension of an array of arbitrary rank. The  first argument needs to be an  associative! function to enable an efficient  parallel implementation. j Variant of i5 that requires the reduced array to be non-empty and  doesn'<t need an default value. The first argument needs to be an   associative: function to enable an efficient parallel implementation. kLSegmented reduction along the innermost dimension. Performs one individual I reduction per segment of the source array. These reductions proceed in  parallel. 1The source array must have at least rank 1. The 6 array determines L the lengths of the logical sub-arrays, each of which is folded separately. l Variant of k that requires all" segments of the reduced array to  be non-empty and doesn't need a default value. 0The source array must have at least rank 1. The 6 array determines L the lengths of the logical sub-arrays, each of which is folded separately. mHData.List style left-to-right scan, but with the additional restriction ( that the first argument needs to be an  associative function to enable an O efficient parallel implementation. The initial value (second argument) may be  arbitrary. n Variant of m6, where the final result of the reduction is returned % separately. Denotationally, we have - scanl' f e arr = (init res, unit (res!len))  where  len = shape arr  res = scanl f e arr oKData.List style left-to-right scan without an initial value (aka inclusive 2 scan). Again, the first argument needs to be an  associative function.  Denotationally, we have ' scanl1 f e arr = tail (scanl f e arr) pRight-to-left variant of m. qRight-to-left variant of n. rRight-to-left variant of o. sHForward permutation specified by an index mapping. The result array is N initialised with the given defaults and any further values that are permuted F into the result array are added to the current value using the given  combination function. !The combination function must be  associative. Elements that are mapped to  the magic value * by the permutation function are dropped. tHBackward permutation specified by an index mapping from the destination = array specifying which element of the source array to read. u-Map a stencil over an array. In contrast to g), the domain of a stencil function is an  entire  neighbourhoodH of each array element. Neighbourhoods are sub-arrays centred around a _ focal point. They are not necessarily rectangular, but they are symmetric in each dimension a and have an extent of at least three in each dimensions  due to the symmetry requirement, the ^ extent is necessarily odd. The focal point is the array position that is determined by the  stencil. \For those array positions where the neighbourhood extends past the boundaries of the source Y array, a boundary condition determines the contents of the out-of-bounds neighbourhood  positions. vLMap a binary stencil of an array. The extent of the resulting array is the 7 intersection of the extents of the two source arrays. w]Call a foreign function. The form the function takes is dependent on the backend being used. _ The arguments are passed as either a single array or as a tuple of arrays. In addition a pure ` Accelerate version of the function needs to be provided to support backends other than the one  being targeted. xQCall a foreign function with foreign implementations for two different backends. ySCall a foreign function with foreign implementations for three different backends. zTCall a foreign expression function. The form the function takes is dependent on the X backend being used. The arguments are passed as either a single scalar element or as a V tuple of elements. In addition a pure Accelerate version of the function needs to be A provided to support backends other than the one being targeted. {QCall a foreign function with foreign implementations for two different backends. |SCall a foreign function with foreign implementations for three different backends. }&Pipelining of two array computations. Denotationally, we have  8 (acc1 >-> acc2) arrs = let tmp = acc1 arrs in acc2 tmp &Operationally, the array computations acc1 and acc2& will not share any sub-computations, ` neither between each other nor with the environment. This makes them truly independent stages / that only communicate by way of the result of acc1& which is being fed as an argument to acc2. ~'An array-level if-then-else construct. Infix version of ~. Lift a unary function into I. Lift a binary function into I. <Lift a unary function to a computation over rank-1 indices. =Lift a binary function to a computation over rank-1 indices. 'Extract the first component of a pair. (Extract the second component of a pair. 6Converts an uncurried function to a curried function. 4Converts a curried function to a function on pairs. "The one index for a rank-0 array. Turn an / expression into a rank-1 indexing expression. *Turn a rank-1 indexing expression into an  expression. 'Creates a rank-2 index from two Exp Int`s 3Destructs a rank-2 index to an Exp tuple of two Int`s. 'Get the outermost dimension of a shape -Get all but the outermost element of a shape LMap a multi-dimensional index into a linear, row-major representation of an H array. The first argument is the array shape, the second is the index.  Inverse of  6Conditional expression. If the predicate evaluates to  , the first 6 component of the tuple is returned, else the second. 5Expression form that extracts a scalar from an array GExpression form that extracts a scalar from an array at a linear index /Extraction of the element in a singleton array Test whether an array is empty 2Expression form that yields the shape of an array 1Expression form that yields the size of an array 6The total number of elements in an array of the given +  x i shifts x left by i bits if i is positive, or right by  -iF bits otherwise. Right shifts perform sign extension on signed number 2 types; i.e. they fill the top bits with 1 if the x is negative and with 0  otherwise. 8Shift the argument left by the specified number of bits  (which must be non-negative). KShift the first argument right by the specified number of bits. The result O is undefined for negative shift amounts and shift amounts greater or equal to  the bitSize. KRight shifts perform sign extension on signed number types; i.e. they fill  the top bits with 1 if the x# is negative and with 0 otherwise.  x i rotates x left by i bits if i is positive, or right by  -i bits otherwise. 9Rotate the argument left by the specified number of bits  (which must be non-negative). :Rotate the argument right by the specified number of bits  (which must be non-negative). bit i is a value with the i$th bit set and all other bits clear x `setBit` i is the same as  x .|. bit i x `clearBit` i is the same as x .&. complement (bit i) x ` complementBit` i is the same as x `xor` bit i Return  if the nth bit of the argument is 1 -Equality lifted into Accelerate expressions. /Inequality lifted into Accelerate expressions. 1Smaller-than lifted into Accelerate expressions. 5Greater-or-equal lifted into Accelerate expressions. 1Greater-than lifted into Accelerate expressions. 5Smaller-or-equal lifted into Accelerate expressions. &Determine the maximum of two scalars. &Determine the minimum of two scalars.  truncate x returns the integer nearest x between zero and x. round x returns the nearest integer to x, or the even integer if x is # equidistant between two integers. floor x/ returns the greatest integer not greater than x.  ceiling x) returns the least integer not less than x.  Conjunction  Disjunction  Negation Convert a Boolean value to an , where  turns into '0' and   into '1'. %General coercion from integral types LMagic value identifying elements that are ignored in a forward permutation. > Note that this currently does not work for singleton arrays. LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrscombination function array of default values  permutation array to be permuted tshape of the result array  permutation  source array ustencil function boundary condition  source array destination array vbinary stencil function boundary condition #1  source array #1 boundary condition #2  source array #2 destination array wxyz{|}~ if-condition  then-array  else-array     sHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~    non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None4)Zip three arrays with the given function (Zip four arrays with the given function ICombine the elements of two arrays pairwise. The shape of the result is . the intersection of the two argument shapes. DTake three arrays and return an array of triples, analogous to zip. FTake four arrays and return an array of quadruples, analogous to zip. The converse of 7, but the shape of the two results is identical to the  shape of the argument. FTake an array of triples and return three arrays, analogous to unzip. HTake an array of quadruples and return four arrays, analogous to unzip. BReduction of an array of arbitrary rank to a single scalar value.  Variant of 5 that requires the reduced array to be non-empty and  doesn't need an default value. *Check if all elements satisfy a predicate -Check if any element satisfies the predicate Check if all elements are  Check if any element is  Compute the sum of elements $Compute the product of the elements DYield the minimum element of an array. The array must not be empty. DYield the maximum element of an array. The array must not be empty. 4Left-to-right prescan (aka exclusive scan). As for scan , the first argument must be an   associative$ function. Denotationally, we have ) prescanl f e = Prelude.fst . scanl' f e %Left-to-right postscan, a variant of o1 with an initial value. Denotationally, we have ( postscanl f e = map (e `f`) . scanl1 f 4Right-to-left prescan (aka exclusive scan). As for scan , the first argument must be an   associative$ function. Denotationally, we have ) prescanr f e = Prelude.fst . scanr' f e %Right-to-left postscan, a variant of r1 with an initial value. Denotationally, we have ( postscanr f e = map (e `f`) . scanr1 f Segmented version of m Segmented version of n LThe first element of the resulting tuple is a vector of scanned values. The L second element is a vector of segment scan totals and has the same size as  the segment vector. Segmented version of o. Segmented version of . Segmented version of . Segmented version of p. Segmented version of q. Segmented version of r. Segmented version of . Segmented version of .  >Compute head flags vector from segment vector for left-scans. HThe vector will be full of zeros in the body of a segment, and non-zero  otherwise. The flag4 value, if greater than one, indicates that several N empty segments are represented by this single flag entry. This is additional + data is used by exclusive segmented scan. LCompute tail flags vector from segment vector for right-scans. That is, the 3 flag is placed at the last place in each segment. JConstruct a segmented version of a function from a non-segmented version. J The segmented apply operates on a head-flag value tuple, and follows the  procedure of Sengupta et. al. BIndex construction and destruction generalised to integral types. DWe generalise the segment descriptor to integral types because some J architectures, such as GPUs, have poor performance for 64-bit types. So, N there is a tension between performance and requiring 64-bit indices for some J applications, and we would not like to restrict ourselves to either one.  As we don'Dt yet support non-Int dimensions in shapes, we will need to convert # back to concrete Int. However, don''t put these generalised forms into the @ base library, because it results in too many ambiguity errors. /Flattens a given array of arbitrary dimension. 7Create an array where all elements are the same value. ICreate an array of the given shape containing the values x, x+1, etc (in  row-major order). 9Create an array of the given shape containing the values x, x+y,  x+y+y etc. (in row-major order). 0Drop elements that do not satisfy the predicate NCopy elements from source array to destination array according to a map. This & is a backpermute operation where a g$ vector encodes the output to input  index mapping.  For example: & input = [1, 9, 6, 4, 4, 2, 0, 1, 2]  map = [1, 3, 7, 2, 5, 3]   output = [9, 4, 1, 6, 2, 4] MConditionally copy elements from source array to destination array according 5 to a map. This is a backpermute operation where a g vector encodes the : output to input index mapping. In addition, there is a mask vector, and an N associated predication function, that specifies whether an element will be E copied. If not copied, the output array assumes the default vector' s value.  For example:  default = [6, 6, 6, 6, 6, 6]  map = [1, 3, 7, 2, 5, 3]  mask = [3, 4, 9, 2, 7, 5]  pred = (> 4) ' input = [1, 9, 6, 4, 4, 2, 0, 1, 2]   output = [6, 6, 1, 6, 2, 4] NCopy elements from source array to destination array according to a map. This * is a forward-permute operation where a g# vector encodes an input to output M index mapping. Output elements for indices that are not mapped assume the  default vector' s value.  For example:  ' default = [0, 0, 0, 0, 0, 0, 0, 0, 0]  map = [1, 3, 7, 2, 5, 8] ! input = [1, 9, 6, 4, 4, 2, 5]  ' output = [0, 1, 4, 9, 0, 4, 0, 6, 2] HNote if the same index appears in the map more than once, the result is E undefined. The map vector cannot be larger than the input vector. MConditionally copy elements from source array to destination array according 9 to a map. This is a forward-permute operation where a g vector encodes an : input to output index mapping. In addition, there is a mask vector, and an M associated predicate function, that specifies whether an elements will be E copied. If not copied, the output array assumes the default vector' s value.  For example:  ' default = [0, 0, 0, 0, 0, 0, 0, 0, 0]  map = [1, 3, 7, 2, 5, 8]  mask = [3, 4, 9, 2, 7, 5]  pred = (> 4)  input = [1, 9, 6, 4, 4, 2]  ' output = [0, 0, 0, 0, 0, 4, 0, 6, 2] HNote if the same index appears in the map more than once, the result is C undefined. The map and input vector must be of the same length. "Reverse the elements of a vector. ,Transpose the rows and columns of a matrix. Yield the first n7 elements of the input vector. The vector must contain  no more than n elements. Yield all but the first n/ elements of the input vector. The vector must  contain no fewer than n elements. KYield all but the last element of the input vector. The vector must not be  empty. LYield all but the first element of the input vector. The vector must not be  empty. GYield a slit (slice) from the vector. The vector must contain at least  i + n$ elements. Denotationally, we have:  slit i n = take n . drop i 5  x: start y: step map input output map mask  predicate default input output map default input output map mask  predicate default input output 05 non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None(Recover sharing of array computations ? (Recover sharing of scalar expressions ? 5Always float array computations out of expressions ? UConvert a closed array expression to de Bruijn form while also incorporating sharing  information. GConvert a closed function over array computations, while incorporating  sharing information. TConvert an open array expression to de Bruijn form while also incorporating sharing  information. ]Convert an array expression with given array environment layout and sharing information into Z de Bruijn form while recovering sharing at the same time (by introducing appropriate let H bindings). The latter implements the third phase of sharing recovery. The sharing environment envD keeps track of all currently bound sharing variables, keeping them P in reverse chronological order (outermost variable is at the end of the list). Convert a boundary condition GConvert a closed scalar function to de Bruijn form while incorporating  sharing information. LThe current design requires all free variables to be bound at the outermost O level --- we have no general apply term, and so lambdas are always outermost. I In higher-order abstract syntax, this represents an n-ary, polyvariadic  function. IConvert a closed scalar expression to de Bruijn form while incorporating  sharing information. WConvert an open expression with given environment layouts and sharing information into Z de Bruijn form while recovering sharing at the same time (by introducing appropriate let H bindings). The latter implements the third phase of sharing recovery. The sharing environments env and aenv6 keep track of all currently bound sharing variables, ] keeping them in reverse chronological order (outermost variable is at the end of the list). Convert a tuple expression NConvert a scalar expression, which is closed with respect to scalar variables Convert a unary functions  Convert a binary functions !!Convert a unary stencil function ""Convert a binary stencil function #TRecover sharing information and annotate the HOAS AST with variable and let binding [ annotations. The first argument determines whether array computations are floated out of > expressions irrespective of whether they are shared or not   implies floating them out. Also returns the $ s of all R. leaves in environment order  they represent  the free variables of the AST. YNB: Strictly speaking, this function is not deterministic, as it uses stable pointers to W determine the sharing of subterms. The stable pointer API does not guarantee its a completeness; i.e., it may miss some equalities, which implies that we may fail to discover Z some sharing. However, sharing does not affect the denotational meaning of an array H computation; hence, we do not compromise denotational correctness. .There is one caveat: We currently rely on the R and 6 leaves representing free ^ variables to be shared if any of them is used more than once. If one is duplicated, the b environment for de Bruijn conversion will have a duplicate entry, and hence, be of the wrong  size, which is fatal. (The 'buildInitialEnv*'# functions will already bail out.) v%&'()*+,-./012$3456789:;<=>?@ABCDEFGHIJKLMNO(recover sharing of array computations ? (recover sharing of scalar expressions ? 4always float array computations out of expressions? PQR(recover sharing of scalar expressions ? expression to be converted S !"TUVWXYZ[\]^_`abcdefghijklmnopqrstuv#wxyz{|}~ABDE^%'&()*+-,.10/2$3476589:;<=>?@ABCDEFGIHJKLMNOPQRS !"TUVWXYZ[\]^_`abcdefghijklmnopqrstuv#wxyz{|}~non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneGRun a complete embedded array program using the reference interpreter. :Prepare and run an embedded array program of one argument JPrepare an n-ary embedded array program for execution, returning an n-ary  closure to do so. EStream a lazily read list of input arrays through the given program,  collecting results as we go b::bnon-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None)      !"            !"non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None#DReify the dimensionality of the result type of an array computation $MReify dimensionality of a computation parameterised over a recursive closure %=Reify dimensionality of a scalar expression yielding a shape &#'$%(&#'$%&#'$%(non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None)Show instances  --------------- )*+,- )*+,-non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None./././non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None0123456789:;<=>?@ABCD0123456789:;<=>?@ABCD 0123456789:;<=>?@ABCDnon-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneGEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~GGEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None  non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None  non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>NoneIRecast terms into the internal fusion delayed array representation to be O forged into combined terms. Using the reduced internal form limits the number - of combinations that need to be considered. :Apply the fusion transformation to a closed de Bruijn AST AApply the fusion transformation to a function of array arguments EAn optional second phase of the fusion transformation that makes the ! representation of fused consumer/-producer terms explicit. Note that quenching  happens after annealing. +TODO: integrate this with the first phase? JApply the fusion transformation to the AST to combine and simplify terms.  This combines producer!producer terms and makes consumerproducer nodes  adjacent. @ 8non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None 'Recover sharing of array computations? 'Recover sharing of scalar expressions? BAre array computations floated out of expressions irrespective of , whether they are shared or not? Requires . >Fuse array computations? This also implies simplifying scalar 0 expressions. NOTE: currently always enabled. :Convert segment length arrays into segment offset arrays? GThe default method of converting from HOAS to de Bruijn; incorporating - sharing recovery and fusion optimisation. ?Convert a closed array expression to de Bruijn form while also 7 incorporating sharing observation and array fusion. HConvert a unary function over array computations, incorporating sharing  observation and array fusion JConvert a closed scalar expression, incorporating sharing observation and  optimisation. GConvert closed scalar functions, incorporating sharing observation and  optimisation. +       non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None%Determine the type of an expressions ' ------------------------------------- Determine an array type  ------------------------ $Reify the element type of an array. >Reify the element type of the result of an array computation. ]Reify the element type of the result of an array computation using the array computation AST  before tying the knot. .Reify the result type of a scalar expression. [Reify the result types of of a scalar expression using the expression AST before tying the  knot. Size of a tuple type, in bytes   non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>None%Array indexing in plain Haskell code Rank of an array "Array shape in plain Haskell code 2Total number of elements in an array of the given Shape   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~J:9876;BC@A+>?<=&'()*543210/.-,fabdc~}estghijklmonprquvH`_^]\[ZYXWVUTSRQwxyz{|I "!%$# NOPLMKFGDE ! " # $ %&'(&')&'*&'+ ,&-.&-/&-0&-1&23&24&25&26&27&28&29&2:&2;&2<&2=&2>&2?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`aabbccddefghijklmnopqrstuvwxyz{|}~      !"#$$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     KPLMNO !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !&^                         j         i k           ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U P V W X  Y Z [ \ ] ^ _ ` a b c d  e  f g h i j k l m n o p q r s s t i u v w x y z { | } ~     K                                                                                                             >     jUPVWXZ[\_`abcdektiuvwxyz{|}~K !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        !"#$%&'()*+,-./0=123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~=~klmnopqrstuvwx}yz{|abcdefg hij     1 !"#$%&'()*+,-./0123456789:;<=>?@ABCDE FGHIJKLMNOPQRSTUVVWX*YZ[\]^_`abcdefaccelerate-0.13.0.2Data.Array.Accelerate!Data.Array.Accelerate.InterpreterData.Array.Accelerate.Debug$Data.Array.Accelerate.Internal.CheckData.Array.Accelerate.Type*Data.Array.Accelerate.Array.Representation Data.Array.Accelerate.Array.Data!Data.Array.Accelerate.Array.SugarData.Array.Accelerate.TupleData.Array.Accelerate.AST$Data.Array.Accelerate.Analysis.Match&Data.Array.Accelerate.Analysis.Stencil#Data.Array.Accelerate.Array.Delayed(Data.Array.Accelerate.Trafo.SubstitutionData.Array.Accelerate.SmartData.Array.Accelerate.LanguageData.Array.Accelerate.Prelude#Data.Array.Accelerate.Trafo.Sharing"Data.Array.Accelerate.Pretty.Print Data.Array.Accelerate.Trafo.Base$Data.Array.Accelerate.Analysis.ShapeData.Array.Accelerate.Pretty#Data.Array.Accelerate.Trafo.Rewrite%Data.Array.Accelerate.Pretty.Traverse#Data.Array.Accelerate.Trafo.Algebra"Data.Array.Accelerate.Trafo.Shrink$Data.Array.Accelerate.Trafo.Simplify"Data.Array.Accelerate.Trafo.FusionData.Array.Accelerate.Trafo#Data.Array.Accelerate.Analysis.Typeghc-prim GHC.TypesBoolCharDoubleFloatIntbaseGHC.IntInt8Int16Int32Int64WordGHC.WordWord8Word16Word32Word64Foreign.C.TypesCCharCSCharCUCharCShortCUShortCIntCUIntCLongCULongCLLongCULLongCFloatCDoubleBoundaryConstantWrapMirrorClampIsScalar IsBoundedIsNumIsNonNum IsFloating IsIntegralSlice SliceShape CoSliceShape FullShape sliceIndexShapeDIM9DIM8DIM7DIM6DIM5DIM4DIM3DIM2DIM1DIM0SegmentsVectorScalarArrayArraysEltAnyAll:.Z fromIArraytoIArrayfromListtoListStencilExpAccconstantUnliftunliftLiftPlainlift Stencil5x5x5 Stencil3x5x5 Stencil5x3x5 Stencil5x5x3 Stencil3x3x5 Stencil3x5x3 Stencil5x3x3 Stencil3x3x3 Stencil5x5 Stencil3x5 Stencil5x3 Stencil3x3Stencil9Stencil7Stencil5Stencil3useunit replicategeneratereshapeslicemapzipWithfoldfold1foldSegfold1Segscanlscanl'scanl1scanrscanr'scanr1permute backpermutestencilstencil2 foreignAcc foreignAcc2 foreignAcc3 foreignExp foreignExp2 foreignExp3>->cond?|lift1lift2ilift1ilift2fstsndcurryuncurryindex0index1unindex1index2unindex2 indexHead indexTailtoIndex fromIndex?!!!thenullshapesize shapeSizeshiftshiftLshiftRrotaterotateLrotateRbitsetBitclearBit complementBittestBit==*/=*<*>=*>*<=*maxmintruncateroundfloorceiling&&*||*not boolToInt fromIntegralignorezipWith3zipWith4zipzip3zip4unzipunzip3unzip4foldAllfold1Allallanyandorsumproductminimummaximumprescanl postscanlprescanr postscanrscanlSeg scanl'Seg scanl1Seg prescanlSeg postscanlSegscanrSeg scanr'Seg scanr1Seg prescanrSeg postscanrSegflattenfill enumFromN enumFromStepNfiltergathergatherIfscatter scatterIfreverse transposetakedropinittailslitrunrun1stream evalPrimConstevalPrimevalPrj indexArrayarrayDim arrayShape arraySizeFlags _dump_sharing_dump_simpl_stats_dump_simpl_iterations_verbose _acc_sharing _exp_sharing_fusion _simplifyFlagSpecOptionTick FusionDoneSimplifierDone Substitution BetaReduce KnownBranch RuleFiredInlineId TickCount SimplStatsDetailticksdetailsSimple acc_sharing dump_sharingdump_simpl_iterationsdump_simpl_stats exp_sharingfusionsimplifyverboseallFlagsdflagsfflags initialiseoptions queryFlagsetFlagwhen traceMessage traceEvent tracePureinline ruleFired knownBranch betaReduce substitutionsimplifierDone fusionDonetickannotate statisticsinitSimplCountresetSimplCount simplTick pprSimplCount simplCountaddTick pprTickCount pprTickGroup tickToTag tickToStr pprTickCtxpprId$fShowSimplStatsChecksInternalUnsafeBoundsdoBoundsChecksdoUnsafeChecksdoInternalChecksdoChecksmessageerrorcheckwarning assert_msgassertcheckIndex_msg checkIndexcheckLength_msg checkLengthcheckSlice_msg checkSlice ScalarType BoundedTypeNumType NonNumType FloatingType IntegralType TupleType PairTuple SingleTuple UnitTuple scalarType boundedTypenumType nonNumType floatingType integralTypeNonNumScalarType NumScalarTypeNonNumBoundedTypeIntegralBoundedTypeFloatingNumTypeIntegralNumType TypeCUChar TypeCSChar TypeCCharTypeCharTypeBool TypeCDouble TypeCFloat TypeDouble TypeFloat TypeCULLong TypeCLLong TypeCULong TypeCLong TypeCUIntTypeCInt TypeCUShort TypeCShort TypeWord64 TypeWord32 TypeWord16 TypeWord8TypeWord TypeInt64 TypeInt32 TypeInt16TypeInt8TypeInt NonNumDict FloatingDict IntegralDict Typeable9typeOf9 Typeable8typeOf8 myMkTyContypeOf7DefaulttypeOf8Default integralDict floatingDict nonNumDict$fIsScalarCUChar$fIsScalarCSChar$fIsScalarCChar$fIsScalarChar$fIsScalarBool$fIsScalarCDouble$fIsScalarCFloat$fIsScalarDouble$fIsScalarFloat$fIsScalarCULLong$fIsScalarCLLong$fIsScalarCULong$fIsScalarCLong$fIsScalarCUInt$fIsScalarCInt$fIsScalarCUShort$fIsScalarCShort$fIsScalarWord64$fIsScalarWord32$fIsScalarWord16$fIsScalarWord8$fIsScalarWord$fIsScalarInt64$fIsScalarInt32$fIsScalarInt16$fIsScalarInt8 $fIsScalarInt$fIsBoundedCUChar$fIsBoundedCSChar$fIsBoundedCChar$fIsBoundedChar$fIsBoundedBool$fIsBoundedCULLong$fIsBoundedCLLong$fIsBoundedCULong$fIsBoundedCLong$fIsBoundedCUInt$fIsBoundedCInt$fIsBoundedCUShort$fIsBoundedCShort$fIsBoundedWord64$fIsBoundedWord32$fIsBoundedWord16$fIsBoundedWord8$fIsBoundedWord$fIsBoundedInt64$fIsBoundedInt32$fIsBoundedInt16$fIsBoundedInt8$fIsBoundedInt$fIsNumCDouble $fIsNumCFloat $fIsNumDouble $fIsNumFloat$fIsNumCULLong $fIsNumCLLong $fIsNumCULong $fIsNumCLong $fIsNumCUInt $fIsNumCInt$fIsNumCUShort $fIsNumCShort $fIsNumWord64 $fIsNumWord32 $fIsNumWord16 $fIsNumWord8 $fIsNumWord $fIsNumInt64 $fIsNumInt32 $fIsNumInt16 $fIsNumInt8 $fIsNumInt$fIsNonNumCUChar$fIsNonNumCSChar$fIsNonNumCChar$fIsNonNumChar$fIsNonNumBool$fIsFloatingCDouble$fIsFloatingCFloat$fIsFloatingDouble$fIsFloatingFloat$fIsIntegralCULLong$fIsIntegralCLLong$fIsIntegralCULong$fIsIntegralCLong$fIsIntegralCUInt$fIsIntegralCInt$fIsIntegralCUShort$fIsIntegralCShort$fIsIntegralWord64$fIsIntegralWord32$fIsIntegralWord16$fIsIntegralWord8$fIsIntegralWord$fIsIntegralInt64$fIsIntegralInt32$fIsIntegralInt16$fIsIntegralInt8$fIsIntegralInt$fShowTupleType$fShowScalarType$fShowBoundedType $fShowNumType$fShowNonNumType$fShowFloatingType$fShowIntegralType $fTypeable8s$fTypeable9(,,,,,,,,) $fTypeable7s$fTypeable8(,,,,,,,) SliceIndex SliceFixedSliceAllSliceNildim intersectbounditeriter1 rangeToShape shapeToRange shapeToList listToShape$fShowSliceIndex $fSlice(,) $fSlice(,)0 $fSlice() $fShape(,) $fShape() ArrayEltRArrayEltMutableArrayData ArrayData runArrayData ArrayPtrsunsafeIndexArrayDataptrsOfArrayData newArrayDataunsafeReadArrayDataunsafeWriteArrayDataunsafeFreezeArrayDataptrsOfMutableArrayDataarrayElt ArrayEltRpairArrayEltRcucharArrayEltRcscharArrayEltRcchar ArrayEltRchar ArrayEltRboolArrayEltRcdoubleArrayEltRcfloatArrayEltRdoubleArrayEltRfloatArrayEltRcullongArrayEltRcllongArrayEltRculongArrayEltRclongArrayEltRcuint ArrayEltRcintArrayEltRcushortArrayEltRcshortArrayEltRword64ArrayEltRword32ArrayEltRword16ArrayEltRword8 ArrayEltRwordArrayEltRint64ArrayEltRint32ArrayEltRint16 ArrayEltRint8 ArrayEltRint ArrayEltRunit GArrayDatatoBoolfromBool fstArrayData sndArrayData pairArrayDataunsafeIndexArrayunsafeReadArrayunsafeWriteArrayunsafeNewArray_ uArrayPtr sTUArrayPtr $fArrayElt(,)$fArrayEltCUChar$fArrayEltCSChar$fArrayEltCChar$fArrayEltChar$fArrayEltBool$fArrayEltCDouble$fArrayEltCFloat$fArrayEltDouble$fArrayEltFloat$fArrayEltCULLong$fArrayEltCLLong$fArrayEltCULong$fArrayEltCLong$fArrayEltCUInt$fArrayEltCInt$fArrayEltCUShort$fArrayEltCShort$fArrayEltWord64$fArrayEltWord32$fArrayEltWord16$fArrayEltWord8$fArrayEltWord$fArrayEltInt64$fArrayEltInt32$fArrayEltInt16$fArrayEltInt8 $fArrayEltInt $fArrayElt()$fTypeableGArrayDataAD_Pair AD_CUChar AD_CSCharAD_CCharAD_CharAD_Bool AD_CDouble AD_CFloat AD_DoubleAD_Float AD_CULLong AD_CLLong AD_CULongAD_CLongAD_CUIntAD_CInt AD_CUShort AD_CShort AD_Word64 AD_Word32 AD_Word16AD_Word8AD_WordAD_Int64AD_Int32AD_Int16AD_Int8AD_IntAD_Unit sliceAnyIndexEltReprGHC.ListsingletonScalarTypenewArray allocateArray array-0.4.0.1Data.Array.BaseIArray showShapearraysarrays'toArrtoArr'fromArrfromArr'ArraysR ArraysRpair ArraysRarray ArraysRunitArrRepr'ArrReprForeign strForeigneltTypefromElttoElteltType'fromElt'toElt'EltRepr' liftToElt liftToElt2 sinkFromElt sinkFromElt2 $fShowArray $fSliceAny $fSlice:. $fSlice:.0$fSliceZ $fShape:.$fShapeZ$fArrays(,,,,,,,,)$fArrays(,,,,,,,)$fArrays(,,,,,,)$fArrays(,,,,,)$fArrays(,,,,) $fArrays(,,,) $fArrays(,,) $fArrays(,) $fArraysArray $fArrays()$fElt(,,,,,,,,)$fElt(,,,,,,,) $fElt(,,,,,,) $fElt(,,,,,) $fElt(,,,,) $fElt(,,,) $fElt(,,)$fElt(,) $fEltCUChar $fEltCSChar $fEltCChar $fEltChar $fEltBool $fEltCDouble $fEltCFloat $fEltDouble $fEltFloat $fEltCULLong $fEltCLLong $fEltCULong $fEltCLong $fEltCUInt $fEltCInt $fEltCUShort $fEltCShort $fEltWord64 $fEltWord32 $fEltWord16 $fEltWord8 $fEltWord $fEltInt64 $fEltInt32 $fEltInt16 $fEltInt8$fEltInt$fEltAny $fEltAny0$fEltAll$fElt:.$fEltZ$fElt()IsTupleTupleIdxAtupleTuple TupleRepr fromTupletoTuple SuccTupIdx ZeroTupIdxSnocAtupNilAtupSnocTupNilTup$fIsTuple(,,,,,,,,)$fIsTuple(,,,,,,,)$fIsTuple(,,,,,,)$fIsTuple(,,,,,)$fIsTuple(,,,,)$fIsTuple(,,,) $fIsTuple(,,) $fIsTuple(,) $fIsTuple()PrimFun PrimConstPreExpOpenExp PreOpenExpFunPreFunOpenFun PreOpenFunStencilR PreOpenAccAfunPreAfun PreOpenAfunPrimFromIntegral PrimBoolToIntPrimChrPrimOrdPrimLNotPrimLOrPrimLAndPrimMinPrimMaxPrimNEqPrimEqPrimGtEqPrimLtEqPrimGtPrimLt PrimCeiling PrimFloor PrimRound PrimTruncate PrimAtan2 PrimLogBasePrimFPowPrimLogPrimSqrtPrimExpFloating PrimAtanh PrimAcosh PrimAsinhPrimAtanPrimAcosPrimAsinPrimTanPrimCosPrimSin PrimRecipPrimFDiv PrimBRotateR PrimBRotateL PrimBShiftR PrimBShiftLPrimBNotPrimBXorPrimBOrPrimBAndPrimModPrimIDivPrimRemPrimQuotPrimSigPrimAbsPrimNegPrimMulPrimSubPrimAddPrimPi PrimMaxBound PrimMinBound Intersect ShapeSize LinearIndexIndexPrimAppIterateCond FromIndexToIndex IndexFull IndexSliceIndexAny IndexTail IndexHead IndexConsIndexNilPrjConstVarLetLamBody StencilRtup9 StencilRtup7 StencilRtup5 StencilRtup3 StencilRunit9 StencilRunit7 StencilRunit5 StencilRunit3 stencilAccessOpenAccStencil2 BackpermutePermuteScanr1Scanr'ScanrScanl1Scanl'ScanlFold1SegFoldSegFold1FoldZipWithMap Replicate TransformGenerateReshapeUnitUseAcondAforeignApplyAprjAvarAletOpenAfunAlamAbodyValEltPushEltEmptyEltValPushEmptyIdxSuccIdxZeroIdxidxToInt tupleIdxToIntprjprjElt invertShape showPreAccOp showArraysshowShortendArr showPreExpOp$fStencil:.a(,,,,,,,,)$fStencil:.a(,,,,,,)$fStencil:.a(,,,,)$fStencil:.a(,,)$fStencil:.e(,,,,,,,,)$fStencil:.e(,,,,,,)$fStencil:.e(,,,,)$fStencil:.e(,,)HashAccMatchAcc:=:REFL matchOpenAccmatchPreOpenAcc matchAtuple matchOpenAfunmatchPreOpenAfun matchBoundary matchArrays matchOpenExpmatchPreOpenExp matchOpenFunmatchPreOpenFun matchConstevalEqmatchIdx matchTupleIdx matchTuplematchSliceRestrictmatchSliceExtendmatchPrimConst matchPrimFun matchPrimFun'matchTupleTypematchScalarType matchNumTypematchBoundedTypematchIntegralTypematchFloatingTypematchNonNumTypecommuteshashIdx hashTupleIdx hashOpenAcchashPreOpenAcc hashArrays hashAtuplehashAfun hashBoundary hashOpenExphashPreOpenExphashPreOpenFun hashTuple hashPrimConst hashPrimFunoffsets positionsRoffsets2 innermost DelayableDelayedRdelayRforceRDelayeddelayforce$fDelayable(,)$fDelayableArray $fDelayable() DelayedRpair DelayedRarrayshapeDArepfDA DelayedRunit substitutecomposeIdxAIAunIA SyntacticAccavarInaccOut weakenAcc RebuildAccIdxEIEunIE SyntacticExpvarInexpOut weakenExp:>weakenAweakenEAweakenFAweakenEweakenFEshiftErebuildE rebuildTE rebuildFErebuildOpenAccshiftArebuildA rebuildAfun rebuildATA rebuildEA rebuildTA rebuildFA$fSyntacticAccPreOpenAcc$fSyntacticAccIdxA$fSyntacticExpPreOpenExp$fSyntacticExpIdxEPreAccPipe StencilRepr stencilPrjTagAtagLevelatup2atup3atup4atup5atup6atup7atup8atup9unatup2unatup3unatup4unatup5unatup6unatup7unatup8unatup9tix0tix1tix2tix3tix4tix5tix6tix7tix8tup2tup3tup4tup5tup6tup7tup8tup9untup2untup3untup4untup5untup6untup7untup8untup9 mkMinBound mkMaxBoundmkPimkSinmkCosmkTanmkAsinmkAcosmkAtanmkAsinhmkAcoshmkAtanh mkExpFloatingmkSqrtmkLogmkFPow mkLogBasemkAddmkSubmkMulmkNegmkAbsmkSigmkQuotmkRemmkIDivmkModmkBAndmkBOrmkBXormkBNot mkBShiftL mkBShiftR mkBRotateL mkBRotateRmkFDivmkRecip mkTruncatemkRoundmkFloor mkCeilingmkAtan2mkLtmkGtmkLtEqmkGtEqmkEqmkNEqmkMaxmkMinmkLAndmkLOrmkLNotmkFromIntegral mkBoolToInt$$$$$$$$$$$$$$TrueFalse$fRealFloatExp $fRealFracExp$fFractionalExp $fFloatingExp $fIntegralExp $fRealExp$fNumExp $fBitsExp$fOrdExp$fEqExp $fEnumExp $fBoundedExp$fUnliftAcc(,,,,,,,,)$fLiftAcc(,,,,,,,,)$fUnliftAcc(,,,,,,,)$fLiftAcc(,,,,,,,)$fUnliftAcc(,,,,,,)$fLiftAcc(,,,,,,)$fUnliftAcc(,,,,,)$fLiftAcc(,,,,,)$fUnliftAcc(,,,,)$fLiftAcc(,,,,)$fUnliftAcc(,,,)$fLiftAcc(,,,)$fUnliftAcc(,,) $fLiftAcc(,,)$fUnliftAcc(,) $fLiftAcc(,)$fLiftAccArray $fLiftAccAcc $fLiftExpExp$fUnliftExp(,,,,,,,,)$fLiftExp(,,,,,,,,)$fUnliftExp(,,,,,,,)$fLiftExp(,,,,,,,)$fUnliftExp(,,,,,,)$fLiftExp(,,,,,,)$fUnliftExp(,,,,,)$fLiftExp(,,,,,)$fUnliftExp(,,,,)$fLiftExp(,,,,)$fUnliftExp(,,,)$fLiftExp(,,,)$fUnliftExp(,,) $fLiftExp(,,)$fUnliftExp(,) $fLiftExp(,) $fLiftExpChar $fLiftExpBool$fLiftExpDouble$fLiftExpFloat$fLiftExpWord64$fLiftExpWord32$fLiftExpWord16$fLiftExpWord8 $fLiftExpWord$fLiftExpInt64$fLiftExpInt32$fLiftExpInt16 $fLiftExpInt8 $fLiftExpInt $fLiftExpAny $fUnliftExp:.$fUnliftExp:.0 $fLiftExp:. $fLiftExp:.0 $fLiftExp:.1 $fUnliftExpZ $fLiftExpZ $fUnliftExp() $fLiftExp() mkHeadFlags mkTailFlags segmentedindex1' unindex1'recoverAccSharingrecoverExpSharing floatOutAcc convertAcc convertAfunconvertOpenAccconvertSharingAccconvertBoundary convertFun convertExpconvertSharingExpconvertSharingTupleconvertRootExpconvertSharingFun1convertSharingFun2convertSharingStencilFun1convertSharingStencilFun2recoverSharingAccStableSharingAcc NodeCount ExpNodeCount AccNodeCount NodeCountsStableSharingExpRootExpEnvExp OccMapExp SharingExp ExpSharing LetSharing VarSharing StableExpName SharingAcc AccSharing AletSharing AvarSharing StableAccNameOccMap OccMapHash ASTHashTable HashTableStableNameHeight StableASTNameFunction FunctionRconvert Afunction AfunctionRaconvertLayout PushLayout EmptyLayoutConfigprjIdxpossiblyNestedErr incLayout sizeLayoutconvertSharingAtuplemkIndex mkReplicateconvertOpenExp makeStableAST higherSNHhashStableNameHeightnewASTHashTableenterOcc freezeOccMaplookupWithASTNamelookupWithSharingAcclookupWithSharingExp higherSSAmatchStableAccnoStableAccName higherSSEmatchStableExpnoStableExpName makeOccMapAccmakeOccMapSharingAcc makeOccMapExpmakeOccMapFun1makeOccMapFun2makeOccMapStencil1makeOccMapStencil2makeOccMapRootExpmakeOccMapSharingExp noNodeCounts accNodeCount expNodeCount+++buildInitialEnvAccbuildInitialEnvExp isFreeVardetermineScopesAccdetermineScopesSharingAccdetermineScopesExpdetermineScopesSharingExprecoverSharingExp traceLine traceChunk_showSharingAccOp$fEqStableSharingExp$fShowStableSharingExp$fEqStableSharingAcc$fShowStableSharingAcc$fEqStableNameHeight$fHashableStableASTName$fEqStableASTName$fShowStableASTName $fFunctionExp$fFunction(->)$fAfunctionAcc$fAfunction(->)run' evalOpenAfun evalOpenAccevalPreOpenAccevalAcc evalAtupleunitOp generateOp transformOp reshapeOp replicateOpsliceOpmapOp zipWithOpfoldOpfold1Op foldSegOp foldSegOp' fold1SegOp fold1SegOp'scanlOpscanl'Opscanl1OpscanrOpscanr'Opscanr1Op permuteOp backpermuteOp stencilOp stencil2Op evalOpenFunevalFun evalOpenExpevalExp evalTupleevalLAndevalLOrevalLNotevalOrdevalChr evalBoolToIntevalFromIntegral evalMinBound evalMaxBoundevalPievalSinevalCosevalTanevalAsinevalAcosevalAtan evalAsinh evalAcosh evalAtanhevalExpFloatingevalSqrtevalLogevalFPow evalLogBase evalTruncate evalRound evalFloor evalCeiling evalAtan2evalAddevalSubevalMulevalNegevalAbsevalSigevalQuotevalRemevalIDivevalModevalBAndevalBOrevalBXorevalBNot evalBShiftL evalBShiftR evalBRotateL evalBRotateRevalFDiv evalRecipevalLtevalGtevalLtEqevalGtEqevalNEqevalMaxevalMin PrettyAcc prettyOpenAcc prettyPreAccprettyBoundary prettyArrOp prettyAfun prettyPreAfun prettyFun prettyPreFunprettyPreOpenFun prettyExp prettyPreExp prettyAtuple prettyTupleprettyTupleIdx prettyConst prettyPrim prettyArrays prettyArraynoParenstuple encloseSepGammaPushExpEmptyExpDelayedOpenAccextentDindexD linearIndexDManifestDelayedOpenFunDelayedOpenExpDelayedOpenAfun DelayedFun DelayedExp DelayedAfun DelayedAccMatchmatchKitinjectextract rebuildAccmatchAcchashAcc prettyAcckmap hashDelayed matchDelayedrebuildDelayed prettyDelayedincExpprjExp lookupExp$fKitDelayedOpenAcc $fMatchacc$fMatchPreOpenAcc$fMatchPreOpenFun$fMatchPreOpenExp $fMatchIdx $fKitOpenAccaccDim preAccDimexpDimAccDim delayedDimndimwide$fShowPreOpenExp$fShowPreOpenFun$fShowPreOpenAfun $fShowaccconvertSegmentsconvertSegmentsAfunLabels accFormat expFormat funFormat tupleFormat arrayFormatboundaryFormat primFunFormatcattravAcctravExptravAfun travArrays travArray travBoundary travAtupletravFun travTuplelabelForPrimFun labelForConst:-> propagate evalPrimAppeval1eval2pprFunevalAdd'evalSub'evalMul' evalIDiv' evalFDiv' UsesOfAcc ReduceAcc ShrinkAccShrinkshrinkshrink' shrinkExp shrinkFun shrinkPreAccbasicReduceAcc usesOfExp usesOfPreAcc$fShrinkPreOpenFun$fShrinkPreOpenExpSimplifylocalCSE recoverLoopssimplifyOpenExpsimplifyOpenFun simplifyExp simplifyFuniterate$fSimplifyPreOpenExp$fSimplifyPreOpenFunDelayAcc quenchAcc annealAccSink1sink1SinksinkExtendPushEnvBaseEnv CunctationStepYieldDoneTermElimAccwithSimplStats quenchAfun annealAfun delayPreAccdoneyieldstepaccType'joinbindcompute computeAcc generateDmapD backpermuteD transformD replicateDsliceDreshapeDzipWithDaletDacondDaprjD isIdentityidentityreindexextendrestrict linearIndex $fSink1acc$fSink1PreOpenAcc$fSink1PreOpenFun$fSink1PreOpenExp $fSink1Idx$fSinkCunctation $fSinkacc$fSinkPreOpenAcc$fSinkPreOpenFun$fSinkPreOpenExp $fSinkIdxfloatOutAccFromExpenableAccFusionconvertOffsetOfSegmentphasesPhaseconvertAccWithconvertAfunWith $fShow(->) $fShowExp $fShow(->)0 $fShowAccAccType arrayTypeaccType preAccTypeexpType preExpTypesizeOfdelayedAccTypedelayedExpType