Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Generate a Array of powers with Accelerate

View AccExp.hs
1 2 3 4 5 6 7 8 9 10 11 12
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 = AI.run $ pows 23.5 42
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.