úÎ><«      Safe-Infered An instance of ScanVectorMachine provides a scalar type s,  vectors of type v s( over that scalar of type, and the full : suite of Scan Vector Machine (SVM) operations (Blelloch'90, D page 60) on those vectors. The SVM instruction set is sometimes  referred to as VCODE$ (CMU tech report CMU-CS-90-146-R). =Only two changes have been made: (1) booleans are encoded as 9 scalars (zero is false, nonzero is true) and (2) Belloch's 8 elementwise subtraction has been replaced with a unary neg D operation; this way the set of elementwise and scan operations are , the same (subtraction is not associative). >Many of the names below overlap with those in the Prelude; we  recommend )import qualified ScanVectorMachine as SVM so that these % may be referred to as, for example,  SVM.length. Notice that there is no map :: (s -> s) -> v s -> v s ; this is  essential to keeping closures and uncontained recursion out of the > parallel context. See Blelloch 10.6.2 for the definition of  contained recursion. =Also notice that only three operations involve communication 2 between different parts of the paralell context:  distribute,  scan, and permute. The  distribute operation performs A broadcast communication from the serial context to the parallel  context. The scan- operation performs prefix scans, which have @ very efficient communication patterns (do a local scan, then a ; global tree reduction, then a local distribution, then an # elementwise operation). Only the permute operation involves @ complicated communication patterns. This is mitigated to some  extent by the requirement that permute must be a  permutation of = the vector; it is an error to send two elements to the same ? destination index, or to have a destination index to which no  element is sent. 3Scalar negation all of the elements of the vector. UElementwise less-than-or-equal-to comparison. Both vectors must be the same length. Elementwise operations (see Op*). Both vectors must be the same length. Prefix scan operations (see Op). If-then-else;  select b x y returns a vector whose i^th element is if b[i] then x[i] else y[i]. . All three vectors must be the same length.  Permutation:  permute v1 v2 returns a vector v3 where v3[v2[i]] = v1[i] for all i. Both vectors / must be the same length and the elements of v2) must all be distinct, non-negative, and ) less than the lengths of the vectors. !Replaces an element of a vector; insert v s i e sets i^th element of the vector to s. The scalar i must be s nonnegative and less than the length of the vector. This instruction implements unicast communication from the + serial context to the parallel context. !Extracts an element of a vector;  extract v i yields v[i]. The scalar i# must be nonnegative and less than y the length of the vector. This instruction implements communication from the parallel context to the serial context. Creates a new vector; distribute s n creates a vector of length n whose elements are all s. ^ This instruction implements communication from the parallel context to the serial context. qReturns the length of a parallel vector. These can be cached in the serial context since the length of a vector @ never depends on data from the paralell context; as a result length* does not actually involve communication. >Scalar operations which may be performed on the elements of a 6 vector, either elementwise or in prefix-scan form.          Safe-Infered Safe-InferedLDefault implementation of segments using an auxiliary segment-length vector  Safe-Infered Safe-Infered Safe-Infered      !"scan-vector-machine-0.2.74Control.Parallel.ScanVectorMachine.ScanVectorMachine:Control.Parallel.ScanVectorMachine.SerialScanVectorMachine=Control.Parallel.ScanVectorMachine.SegmentedScanVectorMachine0Control.Parallel.ScanVectorMachine.NestedVectors9Control.Parallel.ScanVectorMachine.DataParallelHaskellSVM0Control.Parallel.ScanVectorMachine.AccelerateSVMScanVectorMachinenegleqopscanselectpermuteinsertextract distributelengthOpTimesPlusMaxMinOrAndSSVMSegmentedScanVectorMachineVecPaircheck_eq$fScanVectorMachineSSVMe $fShowSSVM$fScanVectorMachineSegVecv$fScanVectorMachineVecPairv'$fScanVectorMachineArrays