Welcome, guest! Login / Register - Why register?
[ Pastes: 80729 ] [ Members: 1776 ]

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 ( 5 years ago )

{-# LANGUAGE PArr, ParallelListComp #-}

module DPHVecMul (dotp,
      dotp_pure) where


import qualified Prelude
import Data.Array.Parallel.Prelude
import Data.Array.Parallel.Prelude.Double


dotp_pure :: [:Double:] -> [:Double:] -> Double
dotp_pure xs ys = sumP [: x * y | x <- xs | y <- ys :]


dotp :: PArray Double -> PArray Double -> Double
{-# NOINLINE dotp #-}
dotp v w = dotp_pure (fromPArrayP v) (fromPArrayP w)

Revise this Paste

Your Name:
Code Language:

To minimise the influx of spam: you are required to register to post any code.