claude · @mathr
318 followers · 3207 posts · Server post.lurk.org

The multidimensional library supports only via (no backend that I could find), and it seems abandoned (doesn't work with GHC newer than 8.10.7, docs mention LLVM 9).

The Haskell multidimensional data parallel array library doesn't support GPU at all as far as I can tell.

I prefer Accelerate's architecture, but Repa seems more maintained.

Repa seems to allow operations:

```
$ ghci -package repa
ghci> :m + Data.Array.Repa
ghci> toList . extract (Z :. 10000000) (Z :. 100) . computeUnboxedS . fromFunction (Z :. (1 :: Int)) $ const (0 :: Int)
[Segmentation fault
$
```

This crash is an out of bounds read, trying to access index 10000000 of an array with one element.

So I started coding a repa-sized wrapper library (I checked Hackage and couldn't find any existing one), that statically ensures things are safe at compilation time. For example, trying to reshape a 3,3 matrix to 5,5 now gives a type error (can't match 9 with 25) instead of a runtime error that the sizes don't match.

#haskell #data #parallel #array #accelerate #gpu #cuda #opencl #repa #unsafe

Last updated 1 year ago