The #Haskell multidimensional #data #parallel #array library #Accelerate supports #GPU only via #CUDA (no #OpenCL 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 #Repa 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 #unsafe 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