Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 75bde07e17
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 14 lines (11 sloc) 0.361 kb
1 2 3 4 5 6 7 8 9 10 11 12 13
import Data.Array.Accelerate as Acc
import Data.Array.Accelerate.Repa as Repa

dotpAcc :: Vector Float -> Vector Float -> Acc (Scalar Float)
dotpAcc xs ys
  = let
      xs' = use xs
      ys' = use ys
    in
    Acc.fold (+) 0 (Acc.zipWith (*) xs' ys')

main = do
   putStrLn $ Repa.run $ dotpAcc (fromList (Z:.3) [1.0,2.0,3.0]) (fromList (Z:.3) [3.4,2.3,1.9])
Something went wrong with that request. Please try again.