}      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     c[2008..2014] Manuel M T Chakravarty, Gabriele Keller [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)NoneJKF !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\456:@ACDEFGHIJKLQT0  !"#*)('&%$+,-.2/013456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\H[2009..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None]Issue an internal error message'$internalError :: String -> String -> a^SThrow an error if the condition evaluates to False, otherwise evaluate the result.4$internalCheck :: String -> String -> Bool -> a -> a_KThrow an error if the index is not in range, otherwise evaluate the result..$boundsCheck :: String -> Int -> Int -> a -> a`<Print a warning message if the condition evaluates to False.6$internalWarning :: String -> String -> Bool -> a -> aabcd]ef^gh_`ijklmnopqrstuv ]ef^gh_`ijadcb]ef^gh_`ijklmnopqrstuv[2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-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. Safe-Inferred !"*+24=JK8Boundary 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 typesw1All scalar element types implement Eq, Ord & Enumx'Bounded element types implement Boundedy*Numeric element types implement Num & Realz2Non-numeric types supported in array computations.{5Floating-point types supported in array computations.|/Integral types supported in array computations. !}~"#$%&'wxyz{|     _  !}~"#$%&'wxyz{|~! }~"#$%&'wxyz{|     [2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"*+234;=HKMGADT to reify the  class. Mutable array representation!Immutable array representation"=Safe combination of creating and fast freezing of array data.#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN !OPQRSTUVWXYZ[\]^_`abcdefghijklm"nopqrstuvwxyz{|}~Q#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN !OPQRSTUVWXYZ[\]^_`abcdefghijk"nopN#$%&' ()*+,-./0MLKJIHGFEDCBA@?>=<;:987654321N !lm"nopqrstuvwxyz{|}~OPQRSTUVWXYZ[\]^_`abcdefghijk[2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None !"234=JKMXGeneralised array index, which may index only in a subset of the dimensions of a shape.Slice representation7Class of slice representations (which are nested pairs)Index representation7Class 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   [2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonell [2013..2014] Robert Clifton-EverestBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"*+234=EJKM$($Slices, aka generalised indices, as nQ-tuples and mappings of slice indices to slices, co-slices, and slice dimensions-.Shapes and indices of multi-dimensional arraysNumber 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 shapesrMap a multi-dimensional index into one in a linear, row-major representation of the array (first argument is the shape!, second argument is the index). Inverse of .'Apply a boundary condition to an index.Iterate through the entire shape, applying the function; third argument combines results and fourth is returned in case of an empty iteration space; the index space is traversed in row-major order. Variant of  without an initial value)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'8/Segment descriptor (vector of segment lengths).fTo 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.9"Vectors are one-dimensional arrays:$Scalars arrays hold a single element;.Multi-dimensional arrays for array processing.If device and host memory are separate, arrays will be transferred to the device when necessary (if possible asynchronously and in parallel with other tasks) and cached on the device if sufficient memory is available.=Accelerate supports as array elements only simple atomic types, and tuples thereof. These element types are stored efficiently in memory, unpacked as consecutive elements without pointers.}This class characterises the types of values that can be array elements, and hence, appear in scalar Accelerate expressions.Type representation mappingiWe represent tuples by using '()' and '(,)' as type-level nil and snoc to construct snoc-lists of types.>wMarker for arbitrary shapes in slice descriptors. Such arbitrary shapes may include an unknown number of dimensions.>> can be used in the leftmost position of a slice instead of D, for example (Any :. _ :. _)!. In the following definition >= is used to match against whatever shape the type variable sh takes: |repN :: (Shape sh, Elt e) => Int -> Acc (Array sh e) -> Acc (Array (sh:.Int) e) repN n a = replicate (constant $ Any :. n) a@2Marker 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.B.Increase an index rank by one dimension. The B7 operator is used to construct both values and types.D Rank-0 indexConvenience functionsYield an array's shapeArray indexing0Create an array from its representation function.Creates a new, uninitialized Accelerate array.F Convert an  to an accelerated array.While the type signature mentions Accelerate internals that are not exported, 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.G#Convert an accelerated array to an .HLConvert a list, with elements in row-major order, into an accelerated array.I:Convert an accelerated array to a list in row-major order.!Nicely format a shape as a string()*+,-./0123456789:;<=>?@ABCDEFGHI      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~P()*+,-./0123456789:;<=>?@ABCDEFGHI()*+,-./0123456789:;<=>?@ABCDEFGHI      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~BC [2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"24=KAConversion 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.@We represent tuples as heterogenous lists, typed by a type list.   [2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonell [2010..2011] Ben LeverBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"*+2346=JKMPrimitive scalar operationsPrimitive GPU constants0Vanilla expression without free scalar variables5Parametrised expression without free scalar variablesVanilla open expressionParametrised 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.SThe data type is parametrised over the surface types (not the representation type)..Vanilla function without free scalar variables3Parametrised function without free scalar variables!Vanilla open function abstraction&Parametrised open function abstractionGADT reifying the  class.Operations on stencils.,Closed array expression aka an array programdCollective array computations parametrised over array variables represented with de Bruijn indices.Scalar functions and expressions embedded in well-formed array computations cannot contain free scalar variable indices. The latter cannot be bound in array computations, and hence, cannot appear in any well-formed program.The let-form is used to represent the sharing discovered by common subexpression elimination as well as to control evaluation order. (We need to hoist array expressions out of scalar expressions - they occur in scalar indexing and in determining an arrays shape.)UThe 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 variablesDParametrised array-computation function without free array variables9Function abstraction over parametrised array computations      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQSV'6      !"A@?>=<;:9876543210/.-,+*)('&%$#BDCEGFHJIKMLNOPQRSTUVWXYZ[\]^ [2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonell [2013..2014] Robert Clifton-EverestBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"*+2346=JKMK0Scalar expressions for plain array computations._Scalar expressions to parametrise collective array operations, themselves parameterised over the type of collective array operations.L$Array-valued collective computations`=Array-valued collective computations without a recursive knotMkScalar expression inlet: make a Haskell value available for processing in an Accelerate scalar expression.?Note that this embeds the value directly into the expression. Depending on the backend used to execute the computation, this might not always be desirable. For example, a backend that does external code generation may embed this constant directly into the generated code, which means new code will need to be generated and compiled every time the value changes. In such cases, consider instead lifting scalar values into (singleton) arrays so that they can be passed as an input to the computation and thus the value can change without the need to generate fresh code.JabKc_defghijklmnopqrstuvwxLy`z{|}~M  !JabKc_defghijklmnopqrstuvwxLy`z{|}~MyJabKc_xwvutsrqponmlkjihgfedLy`~}|{zM c[2008..2014] Manuel M T Chakravarty, Gabriele Keller [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)NoneJKJ^TArray inlet: makes an array available for processing using the Accelerate language.nDepending upon the backend used to execute array computations, this may trigger (asynchronous) data transfer._rScalar inlet: injects a scalar (or a tuple of scalars) into a singleton array for use in the Accelerate language.`FReplicate 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), 7replicate (lift (Z :. (2::Int) :. All :. (3::Int))) arr(yields a three dimensional array, where arrR is replicated twice across the first and three times across the third dimension.a;Construct a new array by applying a function to each index.CFor example, the following will generate a one-dimensional array (9") of three floating point numbers: generate (index1 3) (\_ -> 1.2)Or, equivalently: /generate (constant (Z :. (3::Int))) (\_ -> 1.2)DFinally, the following will create an array equivalent to '[1..10]': [generate (index1 10) $ \ ix -> let (Z :. i) = unlift ix in fromIntegral i NOTE:Using a], it is possible to introduce nested data parallelism, which will cause the program to fail.yIf the index given by the scalar function is then used to dispatch further parallel work, whose result is returned into K. terms by array indexing operations such as () or the, the program will fail with the error: './Data/Array/Accelerate/Trafo/Sharing.hs:447 (convertSharingExp): inconsistent valuation @ shared 'Exp' tree ...'.b@Change the shape of an array without altering its contents. The 4 of the source and result arrays must be identical. !precondition: size ix == size ix'cIndex an array with a  generalised array index, supplied as the 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 `. For example, if matk is a two dimensional array, the following will select a specific row and yield a one dimensional result: 'slice mat (lift (Z :. (2::Int) :. All))!A fully specified index (with no @;s) would return a single element (zero dimensional array).d9Apply the given function element-wise to the given array.eApply the given binary function element-wise to the two arrays. The extent of the resulting array is the intersection of the extents of the two source arrays.fhReduction 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.g Variant of fy that requires the reduced array to be non-empty and doesn't need an default value. The first argument needs to be an  associative9 function to enable an efficient parallel implementation.hSegmented reduction along the innermost dimension. Performs one individual reduction per segment of the source array. These reductions proceed in parallel.1The source array must have at least rank 1. The 8] array determines the lengths of the logical sub-arrays, each of which is folded separately.i Variant of h that requires allQ 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 8] array determines the lengths of the logical sub-arrays, each of which is folded separately.jpData.List style left-to-right scan, but with the additional restriction that the first argument needs to be an  associativeq function to enable an efficient parallel implementation. The initial value (second argument) may be arbitrary.k Variant of jZ, 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 arrl}Data.List style left-to-right scan without an initial value (aka inclusive scan). Again, the first argument needs to be an  associative# function. Denotationally, we have %scanl1 f e arr = tail (scanl f e arr)mRight-to-left variant of j.nRight-to-left variant of k.oRight-to-left variant of l.pForward permutation specified by an index mapping. The result array is initialised with the given defaults and any further values that are permuted into the result array are added to the current value using the given combination function.!The combination function must be  associative and  commutative/. Elements that are mapped to the magic value * by the permutation function are dropped.qBackward permutation specified by an index mapping from the destination array specifying which element of the source array to read.r-Map a stencil over an array. In contrast to d2, the domain of a stencil function is an entire  neighbourhoodp 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 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 array, a boundary condition determines the contents of the out-of-bounds neighbourhood positions.sMap a binary stencil of an array. The extent of the resulting array is the intersection of the extents of the two source arrays.t,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.uPCall a foreign function with foreign implementations for two different backends.vRCall a foreign function with foreign implementations for three different backends.wBCall a foreign expression function. The form the function takes is dependent on the backend being used. The arguments are passed as either a single scalar element or as a tuple of elements. In addition a pure Accelerate version of the function needs to be provided to support backends other than the one being targeted.xPCall a foreign function with foreign implementations for two different backends.yRCall a foreign function with foreign implementations for three different backends.z%Pipelining of two array computations.Denotationally, we have 6(acc1 >-> acc2) arrs = let tmp = acc1 arrs in acc2 tmp{&An array-level if-then-else construct.|An array-level while construct}&Get the outermost dimension of a shape~,Get all but the outermost element of a shapeMap a multi-dimensional index into a linear, row-major representation of an array. The first argument is the array shape, the second is the index. Inverse of Intersection of two shapes&A scalar-level if-then-else construct.While construct. Continue to apply the given function, starting with the initial value, until the test function evaluates to true.4Expression form that extracts a scalar from an arrayFExpression form that extracts a scalar from an array at a linear index1Expression form that yields the shape of an array0Expression form that yields the size of an array6The 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 -ix bits otherwise. Right 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.VShift the argument left by the specified number of bits (which must be non-negative).Shift the first argument right by the specified number of bits. The result is undefined for negative shift amounts and shift amounts greater or equal to the bitSize.gRight 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.WRotate the argument left by the specified number of bits (which must be non-negative).XRotate 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 ix `clearBit` i is the same as x .&. complement (bit i)x `complementBit` i is the same as  x `xor` bit iReturn True if the nth bit of the argument is 1,Equality lifted into Accelerate expressions..Inequality lifted into Accelerate expressions.0Smaller-than lifted into Accelerate expressions.4Greater-or-equal lifted into Accelerate expressions.0Greater-than lifted into Accelerate expressions.4Smaller-or-equal lifted into Accelerate expressions. 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.return if the integer is evenreturn if the integer is odd Conjunction DisjunctionNegationConvert a character to an . Convert an  into a character.Convert a Boolean value to an , where False turns into '0' and True into '1'.$General coercion from integral typesMagic value identifying elements that are ignored in a forward permutation. Note that this currently does not work for singleton arrays.gNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopcombination functionarray of default values permutationarray to be permutedqshape of the result array permutation source arrayrstencil functionboundary condition source arraydestination arraysbinary stencil functionboundary condition #1source array #1boundary condition #2source array #2destination arraytuvwxyz{ if-condition then-array else-array|}~ conditionthen-expressionelse-expression    c !JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~gNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     z n[2009..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonell [2010..2011] Ben LeverBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None 2346=JKM`DA limited subset of types which can be lifted, can also be unlifted.Unlift the outermost constructor through the surface type. This is only possible if the constructor is fully determined by its type - i.e., it is a singleton.The class of types e which can be lifted into c.jAn 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)V have the same "Plain" representation. That is, the following type equality holds: 7Plain (Exp Int, Int) ~ (Int,Int) ~ Plain (Int, Exp Int))Lift the given value into a surface type c --- either K for scalar expressions or LJ for array computations. The value may already contain subexpressions in c.7Zip three arrays with the given function, analogous to e.6Zip four arrays with the given function, analogous to e.6Zip five arrays with the given function, analogous to e.5Zip six arrays with the given function, analogous to e.7Zip seven arrays with the given function, analogous to e.7Zip eight arrays with the given function, analogous to e.6Zip nine arrays with the given function, analogous to e.vCombine the elements of two arrays pairwise. The shape of the result is the intersection of the two argument shapes.CTake three arrays and return an array of triples, analogous to zip.ETake four arrays and return an array of quadruples, analogous to zip.FTake five arrays and return an array of five-tuples, analogous to zip.DTake six arrays and return an array of six-tuples, analogous to zip.HTake seven arrays and return an array of seven-tuples, analogous to zip.HTake seven arrays and return an array of seven-tuples, analogous to zip.HTake seven arrays and return an array of seven-tuples, analogous to zip.The converse of N, but the shape of the two results is identical to the shape of the argument.ETake an array of triples and return three arrays, analogous to unzip.GTake an array of quadruples and return four arrays, analogous to unzip.ETake an array of 5-tuples and return five arrays, analogous to unzip.DTake an array of 6-tuples and return six arrays, analogous to unzip.FTake an array of 7-tuples and return seven arrays, analogous to unzip.FTake an array of 8-tuples and return eight arrays, analogous to unzip.FTake an array of 8-tuples and return eight arrays, analogous to unzip.AReduction of an array of arbitrary rank to a single scalar value. Variant of T 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 predicateCheck if all elements are Check if any element is Compute the sum of elements#Compute the product of the elementsCYield the minimum element of an array. The array must not be empty.CYield 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 l0 with an initial value. Denotationally, we have &postscanl f e = map (e `f`) . scanl1 f4Right-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 o0 with an initial value. Denotationally, we have &postscanr f e = map (e `f`) . scanr1 fSegmented version of jSegmented version of kThe first element of the resulting tuple is a vector of scanned values. The second element is a vector of segment scan totals and has the same size as the segment vector.Segmented version of l.Segmented version of .Segmented version of .Segmented version of m.Segmented version of n.Segmented version of o.Segmented version of .Segmented version of .=Compute head flags vector from segment vector for left-scans. The vector will be full of zeros in the body of a segment, and non-zero otherwise. The "flag" value, if greater than one, indicates that several empty segments are represented by this single flag entry. This is additional data is used by exclusive segmented scan.~Compute tail flags vector from segment vector for right-scans. That is, the flag is placed at the last place in each segment.Construct a segmented version of a function from a non-segmented version. The segmented apply operates on a head-flag value tuple, and follows the procedure of Sengupta et. al.AIndex construction and destruction generalised to integral types.%We generalise the segment descriptor to integral types because some architectures, such as GPUs, have poor performance for 64-bit types. So, there is a tension between performance and requiring 64-bit indices for some applications, and we would not like to restrict ourselves to either one.As we don't 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.6Create an array where all elements are the same value.]Create 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).Concatenate outermost component of two arrays. The extent of the lower dimensional component is the intersection of the two arrays./Drop elements that do not satisfy the predicatetCopy elements from source array to destination array according to a map. This is a backpermute operation where a d5 vector encodes the output to input index mapping. For example: ]input = [1, 9, 6, 4, 4, 2, 0, 1, 2] from = [1, 3, 7, 2, 5, 3] output = [9, 4, 1, 6, 2, 4]Conditionally copy elements from source array to destination array according to an index mapping. This is a backpermute operation where a fromN vector encodes the output to input index mapping. In addition, there is a mask vector, and an associated predication function, that specifies whether an element will be copied. If not copied, the output array assumes the default vector's value. For example: default = [6, 6, 6, 6, 6, 6] from = [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]Copy elements from source array to destination array according to an index mapping. This is a forward-permute operation where a to vector encodes an input to output 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] to = [1, 3, 7, 2, 5, 8] input = [1, 9, 6, 4, 4, 2, 5] output = [0, 1, 4, 9, 0, 4, 0, 6, 2]Note if the same index appears in the index mapping more than once, the result is undefined. It does not makes sense for the to! vector to be larger than the input vector.Conditionally copy elements from source array to destination array according to an index mapping. This is a forward-permute operation where a toP vector encodes an input to output index mapping. In addition, there is a mask vector, and an associated predicate function. The mapping will only occur if the predicate function applied to the mask at that position resolves to H. If not copied, the output array assumes the default vector's value. For example: default = [0, 0, 0, 0, 0, 0, 0, 0, 0] to = [1, 3, 7, 2, 5, 8] mask = [3, 4, 9, 2, 7, 5] pred = (>* 4) input = [1, 9, 6, 4, 4, 2, 5] output = [0, 0, 0, 0, 0, 4, 0, 6, 2]^Note if the same index appears in the mapping more than once, the result is undefined. The to and mask\ vectors must be the same length. It does not make sense for these to be larger than the input vector.!Reverse the elements of a vector.+Transpose the rows and columns of a matrix.Yield the first nE elements of the input vector. The vector must contain no more than n elements.Yield all but the first nH elements of the input vector. The vector must contain no fewer than n elements.TYield all but the last element of the input vector. The vector must not be empty.UYield all but the first element of the input vector. The vector must not be empty.JYield a slit (slice) from the vector. The vector must contain at least i + n# elements. Denotationally, we have: slit i n = take n . drop iInfix version of { . If the predicate evaluates to A, the first component of the tuple is returned, else the second.An infix version of  . If the predicate evaluates to A, the first component of the tuple is returned, else the second.A case-like control structure3Repeatedly apply a function a fixed number of times,Reduce along an innermost slice of an array  sequentiallyV, by applying a binary operator to a starting value and the array from left to right.Lift a unary function into K.Lift a binary function into K.;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 scalar pair.-Extract the first component of an array pair..Extract the second component of a scalar pair.-Extract the second component of an array pair5Converts an uncurried function to a curried function.3Converts 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`s6Destructs a rank-2 index to an Exp tuple of two Int`s..Extraction of the element in a singleton arrayTest whether an array is emptyGet the length of a vectorx: starty: step index mappinginputoutput index mappingmask predicatedefaultinputoutput index mappingdefaultinputoutput index mappingmask predicatedefaultinputoutput case subjectlist of cases to attempt default value !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd\ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdH[2012..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None !"*FHJKM/efghijklmnopqrstuvwxyz{|}~efghijlmpqrsv|}~.efghijklmnopqrstuvwxyz{|}~E[2010..2011] Ben Lever [2010..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"JKMCalculate the offset coordinates for each stencil element relative to the focal point. The coordinates are returned as a flattened list from the bottom-left element to the top-right. This ordering matches the Var indexing order./Position calculation on reified stencil values.[2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None !"24FHJKM H[2012..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None !"=FHJKMOReplace the first variable with the given expression. The environment shrinks.Replace an expression that uses the top environment variable with another. The result of the first is let bound into the second.Composition of unary functions.*   H[2012..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"24FHJKM) ghc[2008..2014] Manuel M T Chakravarty, Gabriele Keller [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"HMCReify the dimensionality of the result type of an array computationLReify dimensionality of a computation parameterised over a recursive closure<Reify dimensionality of a scalar expression yielding a shape[2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"24MShow instances ---------------      H[2012..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None !"FHM       [2008..2014] Manuel M T Chakravarty, Gabriele Keller [2009..2014] Trevor L. McDonell [2013..2014] Robert Clifton-EverestBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None !"24=FKM'Recover sharing of array computations ?'Recover sharing of scalar expressions ?4Always float array computations out of expressions ?bConvert a closed array expression to de Bruijn form while also incorporating sharing information.\Convert a closed function over array computations, while incorporating sharing information.aConvert 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 de Bruijn form while recovering sharing at the same time (by introducing appropriate let bindings). The latter implements the third phase of sharing recovery.The sharing environment env keeps track of all currently bound sharing variables, keeping them in reverse chronological order (outermost variable is at the end of the list).!Convert a boundary condition"\Convert a closed scalar function to de Bruijn form while incorporating sharing information.The current design requires all free variables to be bound at the outermost level --- we have no general apply term, and so lambdas are always outermost. In higher-order abstract syntax, this represents an n-ary, polyvariadic function.#^Convert a closed scalar expression to de Bruijn form while incorporating sharing information.$Convert an open expression with given environment layouts and sharing information into de Bruijn form while recovering sharing at the same time (by introducing appropriate let bindings). The latter implements the third phase of sharing recovery.The sharing environments env and aenv 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&Convert a unary functions'Convert a binary functions( Convert a unary stencil function)!Convert a binary stencil function*Recover 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 M leaves in environment order  they represent the free variables of the AST.NB: Strictly speaking, this function is not deterministic, as it uses stable pointers to determine the sharing of subterms. The stable pointer API does not guarantee its completeness; i.e., it may miss some equalities, which implies that we may fail to discover some sharing. However, sharing does not affect the denotational meaning of an array computation; hence, we do not compromise denotational correctness..There is one caveat: We currently rely on the  and x leaves representing free variables to be shared if any of them is used more than once. If one is duplicated, the 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.),-./0123456789:;<=>+?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_'recover sharing of array computations ?'recover sharing of scalar expressions ?3always float array computations out of expressions? `a!bc"#'recover sharing of scalar expressions ?expression to be convertedd$%&'()efghijklmnopqrstuvwxyz{|}~*QRTU"#h,.-/0123456789:=<;>+?@ABCDGFEHIJKLMNOPQRSTUVWYXZ[\]^_ `a!bc"#d$%&'()efghijklmnopqrstuvwxyz{|}~*H[2012..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"M[2010..2011] Sean SeefriedBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None!"M H[2012..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None  !"FHJKMGGH[2012..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None !"24FJKM  H[2012..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None !"24FHJKMApply the fusion transformation to the AST to combine and simplify terms. This converts terms into the internal delayed array representation and merges adjacent producer/producer terms. Using the reduced internal form limits the number of combinations that need to be considered.9Apply the fusion transformation to a closed de Bruijn AST @Apply the fusion transformation to a function of array arguments GApply the fusion transformation to an AST. This consists of two phases: A bottom-up traversal that converts nodes into the internal delayed representation, merging adjacent producer/producer pairs. eA top-down traversal that makes the representation of fused consumer/producer pairs explicit as a " of manifest and delayed nodes.TLM: Note that there really is no ambiguity as to which state an array will be in following this process: an array will be either delayed or manifest, and the two helper functions are even named as such! We should encode this property in the type somehow...=      !"#$%&'()*+,-./0123456789:;<=>?@ABC 6      !"#$%&'()*+,-./0123456789:;<=>?@ABCH[2012..2014] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None234 D&Recover sharing of array computations?E&Recover sharing of scalar expressions?FnAre array computations floated out of expressions irrespective of whether they are shared or not? Requires D.GmFuse array computations? This also implies simplifying scalar expressions. NOTE: currently always enabled.H9Convert segment length arrays into segment offset arrays?IsThe default method of converting from HOAS to de Bruijn; incorporating sharing recovery and fusion optimisation.JuConvert a closed array expression to de Bruijn form while also incorporating sharing observation and array fusion.KgConvert a unary function over array computations, incorporating sharing observation and array fusionLZConvert a closed scalar expression, incorporating sharing observation and optimisation.MWConvert closed scalar functions, incorporating sharing observation and optimisation.NODEFGHIPJQKRLMSTUVW-NODEFGHIJQKRNODEFGHIPJQKRLMSTUVW[2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None !"FHJKMFRun a complete embedded array program using the reference interpreter.9Prepare and run an embedded array program of one argumentaStream a lazily read list of input arrays through the given program, collecting results as we goaXYZ[\]^_`abcdefghijklmnopqrstuvwxy z{|}~< < `XYZ[\]^_`abcdefghijklmnopqrstuvwxy z{|}~c[2008..2014] Manuel M T Chakravarty, Gabriele Keller [2009..2014] Trevor L. McDonellBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None !"=FHKMKDetermine the type of an expressions -------------------------------------1Determine an array type ------------------------#Reify the element type of an array.=Reify the element type of the result of an array computation.tReify 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.aReify the result types of of a scalar expression using the expression AST before tying the knot.Size of a tuple type, in bytes   [2008..2014] Manuel M T Chakravarty, Gabriele Keller [2008..2009] Sean Lee [2009..2014] Trevor L. McDonell [2013..2014] Robert Clifton-EverestBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)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.1Create an array from its representation function.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~    L<;:98=DEBC-@A>?()*+,76543210/.c^_a`{|zbpqdefghijlkmonrsJ! ]\[ZYXWVUTSRQPONtuvwxyK"$#'&% M}~    HIFG    None 2346=KM.The non-negative magnitude of a complex number,The phase of a complex number, in the range (-, ]2. If the magnitude is zero, then so is the phase. The function  takes a complex number and returns a (magnitude, phase) pair in canonical form: the magnitude is non-negative, and the phase in the range (-, ]1; if the magnitude is zero, then so is the phase.CForm a complex number from polar components of magnitude and phase. t# is a complex value with magnitude 1 and phase t (modulo 2*).(Return the real part of a complex number-Return the imaginary part of a complex number<Return the complex conjugate of a complex number, defined as conjugate(Z) = X - iY   !" !# !$ !% !&'()'(*'(+'(, !-'./'.0'.1'.2'34'35'67'68'69'6:'6;'6<'6='6>'6?'6@'6A'6B'6CDEFGHIJKLMN O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e e f f g g h h i j k l m n o pqrstuvwxyz{|}~       !"#$%&'()*+,-./01234567899:;<=>?@ABCDEFGHIJKLLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./01234567'.8'.9'.:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~OTPQRS               b                                                           ! " # $ % & ' ( ) * + , - . / 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 V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                           n         m o                                                                T                                    m   ! " # $ % & ' ( ) * + , O - . / 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 V  W X Y n    T                 Z o  m   ! " # $ % & ' ( ) * + , O - 0 / 1 2 7  3 4 5 [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                      K L M N O P Q R S T U V !      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQJRSTUVWXYZ[\]^_`abcdeffghijklmnopqrstuvwxyz{|}~l      !"#$%&'()*+,-./0123456789e:;<=>?@ABCDEFGHIJKKLMNOPQRSTUVWXYZ[\]^_`a?bcdefghijklmnopqrstuvwxyz{|}~/)Y.,b ~egiklmnoprstuvwxyz{}/    'accelerate-0.15.1.0Data.Array.Accelerate"Data.Array.Accelerate.Data.Complex!Data.Array.Accelerate.InterpreterData.Array.Accelerate.DebugData.Array.Accelerate.ErrorData.Array.Accelerate.Type Data.Array.Accelerate.Array.Data*Data.Array.Accelerate.Array.Representation!Data.Array.Accelerate.Array.Sugar replicateData.Array.Accelerate.TupleData.Array.Accelerate.ASTData.Array.Accelerate.SmartData.Array.Accelerate.LanguageData.Array.Accelerate.Prelude$Data.Array.Accelerate.Analysis.Match&Data.Array.Accelerate.Analysis.Stencil"Data.Array.Accelerate.Pretty.Print(Data.Array.Accelerate.Trafo.Substitution Data.Array.Accelerate.Trafo.Base$Data.Array.Accelerate.Analysis.ShapeData.Array.Accelerate.Pretty"Data.Array.Accelerate.Trafo.Shrink#Data.Array.Accelerate.Trafo.Sharing#Data.Array.Accelerate.Trafo.Rewrite%Data.Array.Accelerate.Pretty.Traverse#Data.Array.Accelerate.Trafo.Algebra$Data.Array.Accelerate.Trafo.Simplify"Data.Array.Accelerate.Trafo.FusionData.Array.Accelerate.Trafo#Data.Array.Accelerate.Analysis.Typeghc-prim GHC.TypesBoolCharDoubleFloatIntbaseGHC.IntInt8Int16Int32Int64WordGHC.WordWord8Word16Word32Word64 Data.Complex:+ComplexForeign.C.TypesCCharCSCharCUCharCShortCUShortCIntCUIntCLongCULongCLLongCULLongCFloatCDoubleBoundaryConstantWrapMirrorClampIsScalar IsBoundedIsNumIsNonNum IsFloating IsIntegralSlice SliceShape CoSliceShape FullShape sliceIndexShapeDIM9DIM8DIM7DIM6DIM5DIM4DIM3DIM2DIM1DIM0SegmentsVectorScalarArrayArraysEltAnyAll:.Z fromIArraytoIArrayfromListtoListStencilExpAccconstant Stencil5x5x5 Stencil3x5x5 Stencil5x3x5 Stencil5x5x3 Stencil3x3x5 Stencil3x5x3 Stencil5x3x3 Stencil3x3x3 Stencil5x5 Stencil3x5 Stencil5x3 Stencil3x3Stencil9Stencil7Stencil5Stencil3useunitgeneratereshapeslicemapzipWithfoldfold1foldSegfold1Segscanlscanl'scanl1scanrscanr'scanr1permute backpermutestencilstencil2 foreignAcc foreignAcc2 foreignAcc3 foreignExp foreignExp2 foreignExp3>->acondawhile indexHead indexTailtoIndex fromIndex intersectcondwhile!!!shapesize shapeSizeshiftshiftLshiftRrotaterotateLrotateRbitsetBitclearBit complementBittestBit==*/=*<*>=*>*<=*truncateroundfloorceilingevenodd&&*||*notordchr boolToInt fromIntegralignoreUnliftunliftLiftPlainliftzipWith3zipWith4zipWith5zipWith6zipWith7zipWith8zipWith9zipzip3zip4zip5zip6zip7zip8zip9unzipunzip3unzip4unzip5unzip6unzip7unzip8unzip9foldAllfold1Allallanyandorsumproductminimummaximumprescanl postscanlprescanr postscanrscanlSeg scanl'Seg scanl1Seg prescanlSeg postscanlSegscanrSeg scanr'Seg scanr1Seg prescanrSeg postscanrSegflattenfill enumFromN enumFromStepN++filtergathergatherIfscatter scatterIfreverse transposetakedropinittailslit?|?caseofiteratesfoldllift1lift2ilift1ilift2fstafstsndasndcurryuncurryindex0index1unindex1index2unindex2thenulllengthrunrun1stream evalPrimConstevalPrimevalPrj indexArrayarrayDim arrayShape arraySize fromFunction magnitudephasepolarmkPolarcisrealimag conjugateFlags _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$fShowSimplStats internalError internalCheck indexCheckinternalWarningCheckInternalUnsafeBounds boundsError unsafeError boundsCheck unsafeCheck boundsWarning unsafeWarningcallerrorQcheckQwarningQ withLocationlocatedMessage formatLocmessagedoChecksdoBoundsChecksdoUnsafeChecksdoInternalChecks 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 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 byteSwap64 byteSwap32 byteSwap16 ArrayEltRArrayEltMutableArrayData ArrayData runArrayData HTYPE_INT HTYPE_WORD HTYPE_LONGHTYPE_UNSIGNED_LONG HTYPE_CCHAR ArrayPtrsunsafeIndexArrayDataptrsOfArrayData newArrayDataunsafeReadArrayDataunsafeWriteArrayDataunsafeFreezeArrayDataptrsOfMutableArrayDataarrayElt ArrayEltRpairArrayEltRcucharArrayEltRcscharArrayEltRcchar ArrayEltRchar ArrayEltRboolArrayEltRcdoubleArrayEltRcfloatArrayEltRdoubleArrayEltRfloatArrayEltRcullongArrayEltRcllongArrayEltRculongArrayEltRclongArrayEltRcuint ArrayEltRcintArrayEltRcushortArrayEltRcshortArrayEltRword64ArrayEltRword32ArrayEltRword16ArrayEltRword8 ArrayEltRwordArrayEltRint64ArrayEltRint32ArrayEltRint16 ArrayEltRint8 ArrayEltRint ArrayEltRunit GArrayDataAD_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_UnittoBoolfromBool fstArrayData sndArrayData pairArrayDataunsafeIndexArrayunsafeReadArrayunsafeWriteArraystorableArrayPtr $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()TFCo:R:GArrayDataba(,)TFCo:R:GArrayDatabaCUCharTFCo:R:GArrayDatabaCSCharTFCo:R:GArrayDatabaCCharTFCo:R:GArrayDatabaCharTFCo:R:GArrayDatabaBoolTFCo:R:GArrayDatabaCDoubleTFCo:R:GArrayDatabaCFloatTFCo:R:GArrayDatabaDoubleTFCo:R:GArrayDatabaFloatTFCo:R:GArrayDatabaCULLongTFCo:R:GArrayDatabaCLLongTFCo:R:GArrayDatabaCULongTFCo:R:GArrayDatabaCLongTFCo:R:GArrayDatabaCUIntTFCo:R:GArrayDatabaCIntTFCo:R:GArrayDatabaCUShortTFCo:R:GArrayDatabaCShortTFCo:R:GArrayDatabaWord64TFCo:R:GArrayDatabaWord32TFCo:R:GArrayDatabaWord16TFCo:R:GArrayDatabaWord8TFCo:R:GArrayDatabaWordTFCo:R:GArrayDatabaInt64TFCo:R:GArrayDatabaInt32TFCo:R:GArrayDatabaInt16TFCo:R:GArrayDatabaInt8TFCo:R:GArrayDatabaIntTFCo:R:GArrayDataba() SliceIndex SliceFixedSliceAllSliceNildimbounditeriter1 rangeToShape shapeToRange shapeToList listToShape$fShowSliceIndex $fSlice(,) $fSlice(,)0 $fSlice() $fShape(,) $fShape() sliceAnyIndexEltReprsingletonScalarTypenewArray allocateArray array-0.5.0.0Data.Array.BaseIArray showShapearraysarrays'toArrtoArr'fromArrfromArr'ArraysR ArraysRpair ArraysRarray ArraysRunitArrRepr'ArrReprForeign strForeigneltTypefromElttoElteltType'fromElt'toElt'EltRepr' liftToElt liftToElt2 sinkFromElt sinkFromElt2 $fIsListArray $fShowArray $fSliceAny $fSlice:. $fSlice:.0$fSliceZ $fShape:.$fShapeZ$fArrays(,,,,,,,,)$fArrays(,,,,,,,)$fArrays(,,,,,,)$fArrays(,,,,,)$fArrays(,,,,) $fArrays(,,,) $fArrays(,,) $fArrays(,) $fArraysArray $fArrays()TFCo:R:ArrRepr'(,,,,,,,,)TFCo:R:ArrRepr'(,,,,,,,)TFCo:R:ArrRepr'(,,,,,,)TFCo:R:ArrRepr'(,,,,,)TFCo:R:ArrRepr'(,,,,)TFCo:R:ArrRepr'(,,,)TFCo:R:ArrRepr'(,,)TFCo:R:ArrRepr'(,)TFCo:R:ArrRepr'ArrayTFCo:R:ArrRepr'()TFCo:R:ArrRepr(,,,,,,,,)TFCo:R:ArrRepr(,,,,,,,)TFCo:R:ArrRepr(,,,,,,)TFCo:R:ArrRepr(,,,,,)TFCo:R:ArrRepr(,,,,)TFCo:R:ArrRepr(,,,)TFCo:R:ArrRepr(,,)TFCo:R:ArrRepr(,)TFCo:R:ArrReprArrayTFCo:R:ArrRepr()$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()TFCo:R:EltRepr'(,,,,,,,,)TFCo:R:EltRepr'(,,,,,,,)TFCo:R:EltRepr'(,,,,,,)TFCo:R:EltRepr'(,,,,,)TFCo:R:EltRepr'(,,,,)TFCo:R:EltRepr'(,,,)TFCo:R:EltRepr'(,,)TFCo:R:EltRepr'(,)TFCo:R:EltRepr'CUCharTFCo:R:EltRepr'CSCharTFCo:R:EltRepr'CCharTFCo:R:EltRepr'CharTFCo:R:EltRepr'BoolTFCo:R:EltRepr'CDoubleTFCo:R:EltRepr'CFloatTFCo:R:EltRepr'DoubleTFCo:R:EltRepr'FloatTFCo:R:EltRepr'CULLongTFCo:R:EltRepr'CLLongTFCo:R:EltRepr'CULongTFCo:R:EltRepr'CLongTFCo:R:EltRepr'CUIntTFCo:R:EltRepr'CIntTFCo:R:EltRepr'CUShortTFCo:R:EltRepr'CShortTFCo:R:EltRepr'Word64TFCo:R:EltRepr'Word32TFCo:R:EltRepr'Word16TFCo:R:EltRepr'Word8TFCo:R:EltRepr'WordTFCo:R:EltRepr'Int64TFCo:R:EltRepr'Int32TFCo:R:EltRepr'Int16TFCo:R:EltRepr'Int8TFCo:R:EltRepr'IntTFCo:R:EltRepr'AnyTFCo:R:EltRepr'Any0TFCo:R:EltRepr'AllTFCo:R:EltRepr':.TFCo:R:EltRepr'ZTFCo:R:EltRepr'()TFCo:R:EltRepr(,,,,,,,,)TFCo:R:EltRepr(,,,,,,,)TFCo:R:EltRepr(,,,,,,)TFCo:R:EltRepr(,,,,,)TFCo:R:EltRepr(,,,,)TFCo:R:EltRepr(,,,)TFCo:R:EltRepr(,,)TFCo:R:EltRepr(,)TFCo:R:EltReprCUCharTFCo:R:EltReprCSCharTFCo:R:EltReprCCharTFCo:R:EltReprCharTFCo:R:EltReprBoolTFCo:R:EltReprCDoubleTFCo:R:EltReprCFloatTFCo:R:EltReprDoubleTFCo:R:EltReprFloatTFCo:R:EltReprCULLongTFCo:R:EltReprCLLongTFCo:R:EltReprCULongTFCo:R:EltReprCLongTFCo:R:EltReprCUIntTFCo:R:EltReprCIntTFCo:R:EltReprCUShortTFCo:R:EltReprCShortTFCo:R:EltReprWord64TFCo:R:EltReprWord32TFCo:R:EltReprWord16TFCo:R:EltReprWord8TFCo:R:EltReprWordTFCo:R:EltReprInt64TFCo:R:EltReprInt32TFCo:R:EltReprInt16TFCo:R:EltReprInt8TFCo:R:EltReprIntTFCo:R:EltReprAnyTFCo:R:EltReprAny0TFCo:R:EltReprAllTFCo:R:EltRepr:.TFCo:R:EltReprZTFCo:R:EltRepr()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 LinearIndexIndexPrimAppWhileCond FromIndexToIndex IndexFull IndexSliceIndexAny IndexTail IndexHead IndexConsIndexNilPrjConstVarLetLamBody StencilRtup9 StencilRtup7 StencilRtup5 StencilRtup3 StencilRunit9 StencilRunit7 StencilRunit5 StencilRunit3 stencilAccessOpenAccStencil2 BackpermutePermuteScanr1Scanr'ScanrScanl1Scanl'ScanlFold1SegFoldSegFold1FoldZipWithMap Replicate TransformGenerateReshapeUnitUseAwhileAcondAforeignApplyAprjAvarAletOpenAfunAlamAbodyValEltPushEltEmptyEltValPushEmptyIdxSuccIdxZeroIdxidxToInt tupleIdxToIntprjprjElt invertShape showPreAccOp showArraysshowShortendArr showPreExpOp$fStencil:.a(,,,,,,,,)$fStencil:.a(,,,,,,)$fStencil:.a(,,,,)$fStencil:.a(,,)$fStencil:.e(,,,,,,,,)$fStencil:.e(,,,,,,)$fStencil:.e(,,,,)$fStencil:.e(,,)PreAcc StencilRepr stencilPrjTagPipeAtagLevelatup2atup3atup4atup5atup6atup7atup8atup9unatup2unatup3unatup4unatup5unatup6unatup7unatup8unatup9tix0tix1tix2tix3tix4tix5tix6tix7tix8tup2tup3tup4tup5tup6tup7tup8tup9untup2untup3untup4untup5untup6untup7untup8untup9 mkMinBound mkMaxBoundmkPimkSinmkCosmkTanmkAsinmkAcosmkAtanmkAsinhmkAcoshmkAtanh mkExpFloatingmkSqrtmkLogmkFPow mkLogBasemkAddmkSubmkMulmkNegmkAbsmkSigmkQuotmkRemmkIDivmkModmkBAndmkBOrmkBXormkBNot mkBShiftL mkBShiftR mkBRotateL mkBRotateRmkFDivmkRecip mkTruncatemkRoundmkFloor mkCeilingmkAtan2mkLtmkGtmkLtEqmkGtEqmkEqmkNEqmkMaxmkMinmkLAndmkLOrmkLNotmkOrdmkChrmkFromIntegral mkBoolToInt$$$$$$$$$$$$$$ preludeError$fRealFloatExp $fRealFracExp$fFractionalExp $fFloatingExp $fIntegralExp $fRealExp$fNumExp $fBitsExp$fOrdExp$fEqExp $fEnumExp $fBoundedExpTrue mkHeadFlags mkTailFlags segmentedindex1' unindex1'$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(,)$fLiftExpCUChar$fLiftExpCSChar$fLiftExpCChar $fLiftExpChar $fLiftExpBool$fLiftExpCDouble$fLiftExpCFloat$fLiftExpDouble$fLiftExpFloat$fLiftExpCULLong$fLiftExpCLLong$fLiftExpCULong$fLiftExpCLong$fLiftExpCUInt $fLiftExpCInt$fLiftExpCUShort$fLiftExpCShort$fLiftExpWord64$fLiftExpWord32$fLiftExpWord16$fLiftExpWord8 $fLiftExpWord$fLiftExpInt64$fLiftExpInt32$fLiftExpInt16 $fLiftExpInt8 $fLiftExpInt $fLiftExpAny $fUnliftExp:.$fUnliftExp:.0 $fLiftExp:. $fLiftExp:.0 $fLiftExp:.1 $fUnliftExpZ $fLiftExpZ $fUnliftExp() $fLiftExp()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 PrettyAcc prettyOpenAcc prettyPreAcc prettyAfun prettyPreAfun prettyFun prettyPreFunprettyPreOpenFun prettyExp prettyPreExp prettyAtuple prettyTupleprettyTupleIdx prettyConst prettyPrim prettyArrays prettyArraynoParenstuple encloseSep substitutecomposeIdxAIAunIA SyntacticAccavarInaccOut weakenAcc RebuildAccIdxEIEunIE SyntacticExpvarInexpOut weakenExp:>subTopsubAtopweakenAweakenEAweakenFAweakenEweakenFEshiftErebuildE rebuildTE rebuildFErebuildOpenAccshiftArebuildA rebuildAfun rebuildATA rebuildEA rebuildTA rebuildFA$fSyntacticAccPreOpenAcc$fSyntacticAccIdxA$fSyntacticExpPreOpenExp$fSyntacticExpIdxEGammaPushExpEmptyExpDelayedOpenAccDelayedextentDindexD linearIndexDManifestDelayedOpenFunDelayedOpenExpDelayedOpenAfun DelayedFun DelayedExp DelayedAfun DelayedAccMatchmatchKitinjectextract rebuildAccmatchAcchashAcc prettyAcckmap hashDelayed matchDelayedrebuildDelayed prettyDelayedincExpprjExp lookupExp$fKitDelayedOpenAcc $fMatchacc$fMatchPreOpenAcc$fMatchPreOpenFun$fMatchPreOpenExp $fMatchIdx $fKitOpenAccaccDim preAccDimexpDimAccDim delayedDimndimwide$fShowPreOpenExp$fShowPreOpenFun$fShowPreOpenAfun$fShowDelayedOpenAcc $fShowOpenAcc UsesOfAcc ReduceAcc ShrinkAccShrinkshrinkshrink' shrinkExp shrinkFun shrinkPreAccbasicReduceAcc usesOfExp usesOfPreAcc$fShrinkPreOpenFun$fShrinkPreOpenExprecoverAccSharingrecoverExpSharing floatOutAcc convertAcc convertAfunconvertOpenAccconvertSharingAccconvertBoundary convertFun convertExpconvertSharingExpconvertSharingTupleconvertSharingFun1convertSharingFun2convertSharingStencilFun1convertSharingStencilFun2recoverSharingAccStableSharingAcc NodeCount ExpNodeCount AccNodeCountNodeName NodeCountsStableSharingExpRootExp ScopedExp UnscopedExp SharingExp ExpSharing LetSharing VarSharing StableExpName ScopedAcc UnscopedAcc SharingAcc AccSharing AletSharing AvarSharing StableAccNameOccMap OccMapHash ASTHashTable HashTableStableNameHeight StableASTNameFunction FunctionRconvert Afunction AfunctionRaconvertLayout PushLayout EmptyLayoutConfigprjIdxpossiblyNestedErr incLayout sizeLayoutconvertSharingAfun1convertSharingAtuplemkIndex mkReplicateconvertOpenExp makeStableAST higherSNHhashStableNameHeightnewASTHashTableenterOcc freezeOccMaplookupWithASTNamelookupWithSharingAcclookupWithSharingExp higherSSAmatchStableAccnoStableAccName higherSSEmatchStableExpnoStableExpName makeOccMapAccmakeOccMapSharingAccmakeOccMapAfun1 makeOccMapExpmakeOccMapFun1makeOccMapFun2makeOccMapStencil1makeOccMapStencil2makeOccMapRootExpmakeOccMapSharingExp noNodeCounts insertAccNode insertExpNode cleanCountsnodeName+++buildInitialEnvAccbuildInitialEnvExp isFreeVardetermineScopesAccdetermineScopesSharingAccdetermineScopesExpdetermineScopesSharingExprecoverSharingExp traceLine traceChunk$fShowNodeName$fHashableNodeName $fEqNodeName$fEqStableSharingExp$fShowStableSharingExp$fEqStableSharingAcc$fShowStableSharingAcc$fEqStableNameHeight$fHashableStableASTName$fEqStableASTName$fShowStableASTName $fFunctionExp$fFunction(->)$fAfunctionAcc$fAfunction(->)convertSegmentsconvertSegmentsAfunLabels accFormat expFormat funFormat tupleFormat arrayFormatboundaryFormat primFunFormatcattravAcctravExptravAfun travArrays travArray travBoundary travAtupletravFun travTuplelabelForPrimFun labelForConst:-> propagate evalPrimAppeval1eval2pprFunevalAddevalAdd'evalSubevalSub'evalMulevalMul'evalNegevalAbsevalSigevalQuotevalRemevalIDiv evalIDiv'evalModevalBAndevalBOrevalBXorevalBNot evalBShiftL evalBShiftR evalBRotateL evalBRotateRevalFDiv evalFDiv' evalRecipevalSinevalCosevalTanevalAsinevalAcosevalAtan evalAsinh evalAcosh evalAtanhevalExpFloatingevalSqrtevalLogevalFPow evalLogBase evalAtan2 evalTruncate evalRound evalFloor evalCeilingevalLtevalGtevalLtEqevalGtEqevalNEqevalMaxevalMinevalLAndevalLOrevalLNotevalOrdevalChr evalBoolToIntevalFromIntegral evalMinBound evalMaxBoundevalPiSimplifylocalCSE recoverLoopssimplifyOpenExpsimplifyOpenFun simplifyExp simplifyFun$fSimplifyPreOpenExp$fSimplifyPreOpenFunEmbedAccSinkweakenExtendPushEnvBaseEnv CunctationStepYieldDoneEmbedElimAccwithSimplStatsconvertOpenAfun embedOpenAcc embedPreAccdoneyieldstepaccType'appendbindsinksink1computecompute' computeAcc generateDmapD backpermuteD transformD replicateDsliceDreshapeDzipWithDaletDaletD'acondDaprjD isIdentityidentityreindexextendrestrict linearIndex$fSinkCunctation $fSinkacc$fSinkPreOpenAcc$fSinkPreOpenFun$fSinkPreOpenExp $fSinkIdx$fSimplifyCunctationfloatOutAccFromExpenableAccFusionconvertOffsetOfSegmentphasesPhaseconvertAccWithconvertAfunWith $fShow(->) $fShowExp $fShow(->)0 $fShowAccEvalAccconfig evalOpenAfun evalOpenAcc evalAtupleunitOp generateOp transformOp reshapeOp replicateOpsliceOpmapOp zipWithOpfoldOpfold1Op foldSegOp fold1SegOpscanl1OpscanlOpscanl'OpscanrOpscanr1Opscanr'Op permuteOp backpermuteOp stencilOp stencil2Op evalPreExp evalPreFunevalPreOpenFunevalPreOpenExp evalTupleAccType arrayTypeaccType preAccTypeexpType preExpTypesizeOfdelayedAccTypedelayedExpType GHC.Floatpi$fUnliftExpComplex$fLiftExpComplex$fIsTupleComplex $fEltComplexTFCo:R:EltRepr'ComplexTFCo:R:EltReprComplex