Changes between Version 24 and Version 25 of DataParallel/Regular


Ignore:
Timestamp:
Jan 19, 2010 12:43:47 PM (5 years ago)
Author:
gckeller
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/Regular

    v24 v25  
    370370use `forceDArray`, which converts it into an array whose array function is a simple indexing operation (see description of `forceDArray` above). This means that the second version requires more memory, but this is offset by improving the locality for each of the multiplications.  
    371371 
    372 {{{ 
    373 -- mmMult:: (Array.RepFun dim, Array.InitShape dim, Array.Shape dim) =>  
    374 --   DArray (dim :*: Int :*: Int)  Double -> DArray (dim :*: Int :*: Int)  Double -> DArray (dim :*: Int :*: Int)  Double   
    375 mmMult:: 
    376    DArray (() :*: Int :*: Int)  Double -> DArray (() :*: Int :*: Int)  Double -> DArray (() :*: Int :*: Int)  Double   
     372 
     373{{{ 
     374mmMult:: (Array.RepFun dim, Array.InitShape dim, Array.Shape dim) =>  
     375    DArray (dim :*: Int :*: Int)  Double -> DArray (dim :*: Int :*: Int)  Double -> DArray (dim :*: Int :*: Int)  Double   
    377376mmMult arr1@(DArray (sh :*: m1 :*: n1) fn1) arr2@(DArray (sh' :*: m2 :*: n2) fn2) =  
    378   assert ((m1 == n2) && (sh == sh')) $  
    379     mapFold (+) 0 (arr1Ext * arr2Ext) 
    380 --  'fold' doesn't fuse at the moment, so mapFold is significantly faster 
    381 --  fold (+) 0 $ zipWith (*) arr1Ext arr2Ext 
    382   where 
     377   fold (+) 0 (arr1Ext * arr2Ext) 
     378 where 
    383379    arr2T   = forceDArray $ transpose arr2  -- forces evaluation of 'transpose' 
    384380    arr1Ext = replicate arr1 (Array.IndexAll (Array.IndexFixed m2 (Array.IndexAll Array.IndexNil))) 
     
    399395=== Wave computations === 
    400396 
    401 === Generalised Stencil Operation === 
    402  
    403 MapStencil is currently not lifted, and doesn't run in parallel. Need to come up with a generalised version.  
     397=