Welcome, guest! Login / Register - Why register?
[email protected] webmail now available. Want one? Go here.

Paste

N/A
Pasted as Haskell by joaopizani ( 11 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: