۰      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>  K9Boundary 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 +All scalar element types implement Eq, Ord & Enum (Bounded element types implement Bounded $Numeric element types implement Num & Real 3Non-numeric types supported in array computations. 6Floating-point types supported in array computations. 0Integral types supported in array computations. b  !"#$%K !"#$%non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>Mutable array representation Immutable array representation >Safe combination of creating and fast freezing of array data. LGeneralised 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)                   =&CSlices -aka generalised indices- as n-tuples and mappings of slice 5 indicies to slices, co-slices, and slice dimensions '()*+/Shapes and indices of multi-dimensional arrays ,Number of dimensions of a shape or index (>= 0) -,Magic value identifying elements ignored in permute ?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) '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 8 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  !"#$%&./01234Segment descriptor 5Vectors 6Scalars 7.Multi-dimensional arrays for array processing K If device and host memory are separate, arrays will be transferred to the J device when necessary (if possible asynchronously and in parallel with L other tasks) and cached on the device if sufficient memory is available. '8IClass that characterises the types of values that can be array elements. ()*+,-96Identifier for entire dimensions in slice descriptors :./.Representation change for array element types 0 ---------------------------------------------- Type representation mapping The idea is to use '()' and '(,)'* as type-level nil and snoc to construct  snoc-lists of types. 0Convenience functions 12345Yield an array's shape 6Array indexing 71Create an array from its representation function ; Convert an 8 to an accelerated array. <#Convert an accelerated array to an 8 =KConvert a list (with elements in row-major order) to an accelerated array. >;Convert an accelerated array to a list in row-major order. 9$Reify the element type of an array. :&'()*+,-!"#$%&./01234567'8()*+,-9:./1234567;<=>9:&'()*'()*+ ,-,-!"#$%&./01234567''8()*+,-()*+,-9::./1234567;<=>9 :;<= :;<=>?@AB:;<=;<= CBConversion between surface n-tuples and our tuple representation. DEFG*Type-safe projection indicies for tuples. ;NB: We index tuples by starting to count from the *right*! HIJAWe represent tuples as heterogenous lists, typed by a type list. KL CDEFGHIJKL CDEFDEFGIHHIJLKKL eMPrimitive scalar operations NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Primitive GPU constants )Expression without free scalar variables KOpen expressions using de Bruijn indices for variables ranging over tuples G of scalars and arrays of tuples. All code, except Cond, is evaluated 6 eagerly. N-tuples are represented as nested pairs. MThe data type is parametrised over the surface types (not the representation  type). 'Function without free scalar variables Function abstraction -Closed array expression aka an array program @Collective array computations parametrised over array variables % represented with de Bruijn indices. J We have no fold, only scan which returns the fold result and scan array. L We assume that the code generator is clever enough to eliminate any dead 4 code, when only one of the two values is needed. @ 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.) MThe data type is parametrised over the surface types (not the representation  type). eMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~eM4~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  >Reify the element type of the result of an array computation. KReify the element types of the results of an array computation that yields  two arrays. ;Reify the shape type of the result of an array computation LReify the shape type of the results of a computation that yields two arrays .Reify the result type of a scalar expression. -Reify the result type of a tuple projection. Size of a tuple type, in bytes  Show instances  --------------- x?+Smart constructors for stencil reification - ------------------------------------------- 1Conversion from HOAS to de Bruijn expression AST  - @CScalar expressions used to parametrise collective array operations A%Array-valued collective computations 2Conversion from HOAS to de Bruijn computation AST  - @Convert an array expression with given array environment layout Convert a boundary condition "Convert a closed array expression ;Convert an open expression with given environment layouts. Convert a tuple expression 5Convert an expression closed wrt to scalar variables Convert a closed expression Convert a unary functions Convert a binary functions 9Smart constructors to construct representation AST forms ; --------------------------------------------------------- BConstant scalar expression       !"#$%&'()*+,-./0123456789:g?@AB      !"#$%&'()*+,-./0123456789:b?@ AB      !"#$%&'()*+,-./0123456789:non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>QCLCharacterises the types that may be returned when running an array program. DGRun a complete embedded array program using the reference interpreter. ;<=>?@ABCDEFGHIJKLMNEFOGPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~CDEFGCDFEGCDEFGGHIJITurn a tuple of scalar expressions into a scalar expressions that yields  a tuple. KDTurn a scalar expression that yields a tuple into a tuple of scalar  expressions. LMNOPQRSTUVWXYZ[\JArray inlet: makes an array available for processing using the Accelerate E language; triggers asynchronous host->device transfer if necessary. ]HScalar inlet: injects a scalar (or a tuple of scalars) into a singleton + array for use in the Accelerate language. ^BChange the shape of an array without altering its contents, where % precondition: size dim == size dim' _EReplicate 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 (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. `HIndex an array with a *generalised* array index (supplied as the second I argument). The result is a new array (possibly a singleton) containing # all dimensions in their entirety. aJCombine the elements of two arrays pairwise. The shape of the result is . the intersection of the two argument shapes. bThe converse of a7, but the shape of the two results is identical to the  shape of the argument. c9Apply the given function elementwise to the given array. d\Apply the given binary function elementwise to the two arrays. The extent of the resulting D array is the intersection of the extents of the two source arrays. ePrescan of a vector. The type a# together with the binary function L (first argument) and value (second argument) must form a monoid; i.e., the  function must be  associative and the value must be its neutral element. JThe resulting vector of prescan values has the same size as the argument 7 vector. The resulting scalar is the reduction value. fThe right-to-left dual of e. g!Reduction of an array. The type a# together with the binary function M (first argument) and value (second argument) must form a monoid; i.e., the  function must be  associative and the value must be its neutral element. hSegmented reduction. iHForward 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 0 by the permutation function are being dropped. combination function array of default values  permutation permuted array jBackward permutation shape of the result array  permutation permuted array k-Map a stencil over an array. In contrast to c), 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. stencil function boundary condition  source array destination array l\Map a binary stencil of an array. The extent of the resulting array is the intersection of ' the extents of the two source arrays. binary stencil function boundary condition #1  source array #1 boundary condition #2  source array #2 destination array m&Extract the first component of a pair n'Extract the second component of a pair o5Converts an uncurried function to a curried function p3Converts a curried function to a function on pairs qConditional expression. r6Expression form that extracts a scalar from an array. stuvwxyz{|}~-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.  Conjunction  Disjunction  Negation Convert a Boolean value to an , where  turns into '0' and   into '1'. Convert an Int to a Float Round Float to Int Truncate Float to Int KMagic value identifying elements that are ignored in a forward permutation P?@ABHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~GHIJKIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~non-portable (GHC extensions) experimental-Manuel M T Chakravarty <chak@cse.unsw.edu.au>%Array indexing in plain Haskell code "Array shape in plain Haskell code   !"#$%&'()*+,-./0123456789:;<=>?@ABHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  "!%$#76548+,-9:&'()*3210/.;<=>A@?[ZYXWVUTSRQPONMLB\]^`_abcdefghijklHIJKmnopqrsz{|}~tuvwxy !"#$%&%'%(%)%*%+%,%-%.%/%0%1%23456789:;<=>?@ABCDEFGHIJKLMNOPQQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     >?@ABCDE !"#$%&'()O*+,-./0123456789:; < = > ? @ 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 { | } ~         W  $      _       V  X   V                                            $_V      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklaccelerate-0.8.0.0Data.Array.Accelerate!Data.Array.Accelerate.InterpreterPaths_accelerate$Data.Array.Accelerate.Internal.CheckData.Array.Accelerate.Type Data.Array.Accelerate.Array.Data*Data.Array.Accelerate.Array.Representation!Data.Array.Accelerate.Array.Sugar#Data.Array.Accelerate.Array.DelayedData.Array.Accelerate.TupleData.Array.Accelerate.AST#Data.Array.Accelerate.Analysis.TypeData.Array.Accelerate.PrettyData.Array.Accelerate.SmartData.Array.Accelerate.DebugData.Array.Accelerate.Languageghc-primGHC.BoolBool GHC.TypesCharDoubleFloatIntbaseGHC.IntInt8Int16Int32Int64GHC.WordWordWord8Word16Word32Word64Foreign.C.TypesCCharCSCharCUCharCShortCUShortCIntCUIntCLongCULongCLLongCULLongCFloatCDoubleBoundaryConstantWrapMirrorClampIsScalar IsBoundedIsNumIsNonNum IsFloating IsIntegralSliceIxSliceCoSliceSliceDim sliceIndexIxdimsizeDIM5DIM4DIM3DIM2DIM1DIM0SegmentsVectorScalarArrayElemAll fromIArraytoIArrayfromListtoListStencilExpAccconstantArraysrun evalPrimConstevalPrimevalPrjTupleTupleTtupleuntuple Stencil5x5x5 Stencil3x5x5 Stencil5x3x5 Stencil5x5x3 Stencil3x3x5 Stencil3x5x3 Stencil5x3x3 Stencil3x3x3 Stencil5x5 Stencil3x5 Stencil5x3 Stencil3x3Stencil9Stencil7Stencil5Stencil3useunitreshape replicateslicezipunzipmapzipWithscanlscanrfoldfoldSegpermute backpermutestencilstencil2fstsndcurryuncurry?!shapeshiftshiftLshiftRrotaterotateLrotateRbitsetBitclearBit complementBittestBit==*/=*<*>=*>*<=*maxmin&&*||*not boolToInt intToFloatroundFloatToInttruncateFloatToIntignore indexArray arrayShapeversionbindirlibdirdatadir libexecdir getBinDir getLibDir getDataDir getLibexecDirgetDataFileNameChecksInternalUnsafeBoundsdoBoundsChecksdoUnsafeChecksdoInternalChecksdoCheckserrorcheck assert_msgassertcheckIndex_msg checkIndexcheckLength_msg checkLengthcheckSlice_msg checkSlice TupleType PairTuple SingleTuple UnitTuple scalarType boundedTypenumType nonNumType floatingType integralType ScalarTypeNonNumScalarType NumScalarType BoundedTypeNonNumBoundedTypeIntegralBoundedTypeNumTypeFloatingNumTypeIntegralNumType NonNumType TypeCUChar TypeCSChar TypeCCharTypeCharTypeBool FloatingType TypeCDouble TypeCFloat TypeDouble TypeFloat IntegralType TypeCULLong TypeCLLong TypeCULong TypeCLong TypeCUIntTypeCInt TypeCUShort TypeCShort TypeWord64 TypeWord32 TypeWord16 TypeWord8TypeWord TypeInt64 TypeInt32 TypeInt16TypeInt8TypeInt NonNumDict FloatingDict IntegralDict Typeable9typeOf9 Typeable8typeOf8typeOf7DefaulttypeOf8Default integralDict floatingDict nonNumDict ArrayElem ArrayPtrsindexArrayDataptrsOfArrayData newArrayData readArrayDatawriteArrayDataunsafeFreezeArrayDataptrsOfMutableArrayData GArrayDataMutableArrayData ArrayData runArrayData fstArrayData sndArrayData pairArrayDataunsafeNewArray_ uArrayPtr sTUArrayPtr SliceIndex SliceFixedSliceAllSliceNil intersectindexbounditer rangeToShape shapeToRange shapeToList listToShape SliceIxConvconvertSliceIndex FromShapeRepr FromShapeBaseShape ShapeBaseDIM9DIM8DIM7DIM6elemTypefromElemtoElem elemType' fromElem'toElem' ElemRepr'ElemReprsingletonScalarType liftToElem liftToElem2 sinkFromElem sinkFromElem2newArray array-0.3.0.1Data.Array.BaseIArray arrayType DelayableDelayeddelayforce DelayedPair DelayedArrayshapeDArepfDA DelayedUnitIsTuple TupleRepr fromTupletoTupleTupleIdx SuccTupIdx ZeroTupIdxSnocTupNilTupPrimFun PrimBoolToInt PrimIntFloatPrimTruncFloatIntPrimRoundFloatIntPrimChrPrimOrdPrimLNotPrimLOrPrimLAndPrimMinPrimMaxPrimNEqPrimEqPrimGtEqPrimLtEqPrimGtPrimLt PrimAtan2 PrimLogBasePrimFPowPrimLogPrimSqrtPrimExpFloating PrimAtanh PrimAcosh PrimAsinhPrimAtanPrimAcosPrimAsinPrimTanPrimCosPrimSin PrimRecipPrimFDiv PrimBRotateR PrimBRotateL PrimBShiftR PrimBShiftLPrimBNotPrimBXorPrimBOrPrimBAndPrimModPrimIDivPrimRemPrimQuotPrimSigPrimAbsPrimNegPrimMulPrimSubPrimAdd PrimConstPrimPi PrimMaxBound PrimMinBoundOpenExp IndexScalarPrimAppCondPrjConstVarFunOpenFunLamBody stencilAccessOpenAccStencil2 BackpermutePermuteScanrScanlFoldSegFoldZipWithMapIndex ReplicateReshapeUnitUseAvarLet2LetValPushEmptyIdxSuccIdxZeroIdxprjaccTypeaccType2 accShapeType accShapeType2expType tupleIdxTypesizeOf prettyAccprettyBoundary prettyArrOpprettyAccParens prettyFun prettyExp prettyTupleprettyTupleIdx prettyConst prettyPrim prettyArraynoParensidxToInt $fShowOpenAcc StencilRepr stencilPrjLayout PushLayout EmptyLayoutTagSndArrayFstArrayconvertOpenAccconvertBoundary convertAccprjIdxconvertOpenExp convertTuple convertExpconvertClosedExp convertFun1 convertFun2convertStencilFunconvertStencilFun2mkIndex mkReplicatetix0tix1tix2tix3tix4tix5tix6tix7tix8unpairtup2tup3tup4tup5untup2untup3untup4untup5 mkMinBound mkMaxBoundmkPimkSinmkCosmkTanmkAsinmkAcosmkAtanmkAsinhmkAcoshmkAtanh mkExpFloatingmkSqrtmkLogmkFPow mkLogBasemkAddmkSubmkMulmkNegmkAbsmkSigmkQuotmkRemmkIDivmkModmkBAndmkBOrmkBXormkBNot mkBShiftL mkBShiftR mkBRotateL mkBRotateRmkFDivmkRecipmkAtan2mkLtmkGtmkLtEqmkGtEqmkEqmkNEqmkMaxmkMinmkLAndmkLOrmkLNot mkBoolToInt mkIntFloatmkRoundFloatIntmkTruncFloatInt evalOpenAccevalAccunitOp reshapeOp replicateOpindexOpmapOp zipWithOpfoldOp foldSegOpscanlOpscanrOp permuteOp backpermuteOp stencilOp stencil2Op evalOpenFunevalFun evalOpenExpevalExp evalTupleevalLAndevalLOrevalLNotevalOrdevalChrevalRoundFloatIntevalTruncFloatInt evalIntFloat evalBoolToInt evalMinBound evalMaxBoundevalPievalSinevalCosevalTanevalAsinevalAcosevalAtan evalAsinh evalAcosh evalAtanhevalExpFloatingevalSqrtevalLogevalFPow evalLogBase evalAtan2evalAddevalSubevalMulevalNegevalAbsevalSigevalQuotevalRemevalIDivevalModevalBAndevalBOrevalBXorevalBNot evalBShiftL evalBShiftR evalBRotateL evalBRotateRevalFDiv evalRecipevalLtevalGtevalLtEqevalGtEqevalEqevalNEqevalMaxevalMinFalseTrue