Status of Seq ?

22 views
Skip to first unread message

Alexandre Delanoë

unread,
Jul 3, 2020, 8:12:55 PM7/3/20
to Accelerate
Hello,
Sequence operations are commented on the masters version on Github.
There is a particular reason "we" should not use it ?

Besides, I am looking for a foldl1 like function over Acc (instead of Exp).

For instance, here is a minimal example :

example :: Acc (Matrix a) -> Acc (Matrix a)
example m = reshape (shape m) vectors
  where
    vectors = foldl1 (++) $ map (\z -> someOperationsAndSum z m) [0..n-1] --iterate over rows

(someOperationsAndSum ::  Exp Int -> Acc (Matrix a) -> Acc (Vector a))

It compiles but has poor performance since I am not using Accelerate language of fold1.

How you would do this in purely Acc language ?

Many thanks for this library and your help,
Regards,
Alexandre


Alexandre Delanoë

unread,
Jul 4, 2020, 3:29:41 AM7/4/20
to Accelerate


Le samedi 4 juillet 2020 02:12:55 UTC+2, Alexandre Delanoë a écrit :
example :: Acc (Matrix a) -> Acc (Matrix a)
example m = reshape (shape m) vectors
  where
    vectors = foldl1 (++) $ map (\z -> someOperationsAndSum z m) [0..n-1] --iterate over rows

(I could use concatOn _2 to avoid the reshape, but still the fold1 is needed)

Regards
Reply all
Reply to author
Forward
0 new messages