This is a demonstration of calling Futhark from ATS. We use it to provide statistical functions in ATS.
First, get futhark and ATS. Make sure you have OpenCL.
To run:
futhark pkg sync
make
LD_LIBRARY_PATH=target/lib ./target/spec
For slightly better dependency tracking:
futhark pkg sync
./Shakefile.hs run
Find an example showing how to compute the mean of an array here.