Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 5ea4d40ebc
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (13 sloc) 0.434 kB
import Data.Array.Accelerate as Acc
import Data.Array.Accelerate.Repa as Repa
saxpyAcc :: Float -> Vector Float -> Vector Float -> Acc (Vector Float)
saxpyAcc alpha xs ys
= let
xs' = use xs
ys' = use ys
in
Acc.zipWith (\x y -> constant alpha * x + y) xs' ys'
main = do
putStrLn $ Repa.run $ saxpyAcc (1.0) arr1 arr2
arr1 = fromList (Z:.5) [1.0,1.0,1.0,1.0,1.0]
arr2 = fromList (Z:.5) [2.0,2.0,2.0,2.0,2.0]
Jump to Line
Something went wrong with that request. Please try again.