Create a gist now

Instantly share code, notes, and snippets.

@kfl /AccExp.hs
Created May 22, 2012

What would you like to do?
Generate a Array of powers with Accelerate
module AccExp where
import qualified Data.Array.Accelerate as A
import Data.Array.Accelerate (Z(..), (:.)(..),(!))
import qualified Data.Array.Accelerate.Interpreter as AI
pows :: A.Exp Double -> Int -> A.Acc(A.Vector Double)
pows u n =
A.generate (A.index1$ A.constant $ n+1) (\ix -> let i = A.unindex1 ix in u^i)
main = $ pows 23.5 42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment