Changes between Version 24 and Version 25 of DataParallel/Regular
 Timestamp:
 Jan 19, 2010 12:43:47 PM (7 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

DataParallel/Regular
v24 v25 370 370 use `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. 371 371 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 {{{ 374 mmMult:: (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 377 376 mmMult 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 383 379 arr2T = forceDArray $ transpose arr2  forces evaluation of 'transpose' 384 380 arr1Ext = replicate arr1 (Array.IndexAll (Array.IndexFixed m2 (Array.IndexAll Array.IndexNil))) … … 399 395 === Wave computations === 400 396 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 =