{-# 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)

Add a code snippet to your website: www.paste.org