Profile
Pastes: 76590
Members: 1489

Paste

Plain view | Edit code: here. | Add this to your website. | Report abuse.

Short URL: N/A

Pasted as Haskell by joaopizani on Monday, September 27th, 2010 11:59pm ( 4 years ago )

  1. {-# LANGUAGE PArr, ParallelListComp #-}
  2.  
  3. module DPHVecMul (dotp,
  4.       dotp_pure) where
  5.  
  6.  
  7. import qualified Prelude
  8. import Data.Array.Parallel.Prelude
  9. import Data.Array.Parallel.Prelude.Double
  10.  
  11.  
  12. dotp_pure :: [:Double:] -> [:Double:] -> Double
  13. dotp_pure xs ys = sumP [: x * y | x <- xs | y <- ys :]
  14.  
  15.  
  16. dotp :: PArray Double -> PArray Double -> Double
  17. {-# NOINLINE dotp #-}
  18. dotp v w = dotp_pure (fromPArrayP v) (fromPArrayP w)

Revise this Paste
Your Name:
Code Language:
 
Security Image:
Text seen in Image:
Comments

Nothing has been added as yet. Post a comment.