Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AD with Accelerate types #63

Open
alang9 opened this issue Apr 3, 2017 · 0 comments
Open

AD with Accelerate types #63

alang9 opened this issue Apr 3, 2017 · 0 comments

Comments

@alang9
Copy link
Collaborator

alang9 commented Apr 3, 2017

It would be nice to be able to use AD with Accelerate types (like Exp Double or Exp (Complex Double))

I think the big issues are:

  1. A lot of typeclass methods on accelerate types result in bottoms. e.g.
instance P.Eq (Exp a) where
  (==) = preludeError "Eq.==" "(==)"
  (/=) = preludeError "Eq./=" "(/=)"
instance Ord a => P.Ord (Exp a) where
  compare = error "Prelude.Ord.compare applied to EDSL types"
  (<)     = preludeError "Ord.<"  "(<)"
  (<=)    = preludeError "Ord.<=" "(<=)"
  (>)     = preludeError "Ord.>"  "(>)"
  (>=)    = preludeError "Ord.>=" "(>=)"
  min     = min
  max     = max
instance P.Enum (Exp a) where
  toEnum   = preludeError "toEnum"
  fromEnum = preludeError "fromEnum"
instance (Num a, Ord a) => P.Real (Exp a) where
  toRational = P.error "Prelude.toRational not supported for Accelerate types"
  1. Accelerate appears to be very slow at compiling code with recursive functions. It seems better to iterate with Data.Array.Accelerate.while or Data.Array.Accelerate.iterate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant