Accelerate defines an embedded language of array computations for high-performance computing in Haskell. Computations on multi-dimensional, regular arrays are expressed in the form of parameterised collective operations (such as maps, reductions, and permutations). These computations are online-compiled and executed on a range of architectures.
Questions tagged [accelerate-haskell]
20 questions
33
votes
1 answer
Difference in performance of compiled accelerate code ran from ghci and shell
Problem
Hello, I'm using accelerate library to create an application allowing the user to interactively call functions that process images, that's why I'm basing on and extending ghci using ghc api.
The problem is that when running the compiled…

Konrad Madej
- 1,271
- 1
- 11
- 19
13
votes
2 answers
Write a parallel array Haskell expression once, run on CPUs & GPUs with repa and accelerate
Repa and Accelerate API Similarity
The Haskell repa library is for automatically parallel array computation on CPUs. The accelerate library is automatic data parallelism on GPUs. The APIs are quite similar, with identical representations of…

Rob Stewart
- 1,812
- 1
- 12
- 25
5
votes
0 answers
Real-Complex type conversion within Exp / Acc
I need to convert a real numerical value within the Exp or Acc type of the Accelerate library to its corresponding Complex value, e.g.:
toComplex :: Exp Double -> Exp (Complex Double)
toComplex' :: Acc (Vector Double) -> Acc (Vector (Complex…

Phillip Seeber
- 51
- 2
5
votes
1 answer
How to define the matrix product in accelerate-haskell
I am trying to define a typesafe matrix computation library on top of accelerate, partly for educational purposes, partly to see whether this is a practical approach.
But I am completely stuck when it comes to define the product of to matrices…

epsilonhalbe
- 15,637
- 5
- 46
- 74
5
votes
1 answer
How do I enable CUDA on the examples on the accelerate-examples package?
I've installed CUDA on my OSX Yosemite. I've downloaded the accelerate-examples package and compiled it with cabal install. It compiled correctly. When I ran the examples, though, I noticed they do not offer a option to run under CUDA. For…

MaiaVictor
- 51,090
- 44
- 144
- 286
4
votes
1 answer
GHC - Infixl declaration in Haskell
Hi I'm building my own version of a GPU programming Haskell DSL which is called Accelerate. The question is about the the infixl declaration:
Here is the code snippet:
infixl 3 :.
data tail :. head = tail :. head
deriving (Eq, Show)
I think…

VELVETDETH
- 314
- 1
- 8
3
votes
3 answers
Emulating non-rectangular arrays
Often times you want the performance of arrays over linked lists while having not conforming to the requirement of having rectangular arrays.
As an example consider an hexagonal grid, here shown with the 1-distance neighbors of cell (3, 3) in medium…

tsorn
- 3,365
- 1
- 29
- 48
2
votes
1 answer
Accelerate code passes intepreter but fails under CUDA
I have been trying to write a function in that will take a histogram of a vector using the accelerate library. I recognize that histograms aren't the idea case for GPU processing, but I'm generating a fairly large dataset from a small seed and it…

rprospero
- 913
- 11
- 26
2
votes
1 answer
Resize in Accelerate
I have been experimenting with Haskell's Accelerate and I was wondering how I could resize a vector (Array DIM1 a)? I noticed reshape but it the size of the source and result must be the same but I want to double the size.

user3199023
- 433
- 2
- 8
2
votes
1 answer
How do you properly construct an Accelerate array using fromPtr in Haskell?
I'm trying to use fromPtr from accelerate-io to scoop an image out of OpenCV and into an Accelerate array. The documentation for this feature is obtuse, and this example won't compile (I can't install accelerate-examples because of Criterion). This…

transfuturist
- 23
- 4
2
votes
2 answers
What is the most efficient way to read a CSV file into an Accelerate (or Repa) Array?
I am interested in playing around with the Accelerate library, and I would like to perform some operations on data stored inside of a CSV file. I've read this excellent introduction to Accelerate, but I'm not sure how I can go about reading CSVs…

Max
- 15,157
- 17
- 82
- 127
1
vote
1 answer
How to use gloss accelerate to render mandelbrot
as an exercise I'm trying to render the Mandelbrot set using Haskell. I'm using gloss to display the result. So far I got the math correct, and displaying works. At the moment I generate a [[Word8]] which represents the iterations it took for each…

Modi57
- 205
- 1
- 10
1
vote
1 answer
Haskell Accelerate replicate matrix
How can I replicate matrix in Haskell Accelerate?
For example, I have a matrix mat :: Matrix (Z :. 2 :. 5) .... I want to get a three-dimensional array with shape Z :. 9 :. 2 :. 5.
I tried to use A.replicate (A.lift (Z :. 9 :. All)) mat, but I get…

Vyacheslav Siniy
- 35
- 6
1
vote
1 answer
Exp a -> a in Haskell Accelerate
Is there a function with such type signature: Exp a -> a in accelerate library for Haskell?
For example, I have an expression:
max = maximum mat !! 0
where
mat :: Acc (Matrix Int)
Then, max has type Exp Int, but I'd like max to be expressed a…

Vyacheslav Siniy
- 35
- 6
1
vote
1 answer
how to use a cuda DevicePtr as an accelerate Array
I'm trying to use a cuda DevicePtr (which is called a CUdeviceptr in CUDA-land) returned from foreign code as an accelerate Array with accelerate-llvm-ptx.
The code I've written below somewhat works:
import Data.Array.Accelerate
(Acc, Array,…

illabout
- 3,517
- 1
- 18
- 39