Questions tagged [repa]

Repa is a Haskell package for high performance, regular, shape polymorphic parallel arrays.

Repa provides high performance, regular, multi-dimensional, shape polymorphic parallel arrays. All numeric data is stored unboxed. Functions written with the Repa combinators are automatically parallel provided you supply +RTS -Nwhatever on the command line when running the program.

103 questions
91
votes
2 answers

Parallel mapM on Repa arrays

In my recent work with Gibbs sampling, I've been making great use of the RVar which, in my view, provides a near ideal interface to random number generation. Sadly, I've been unable to make use of Repa due to the inability to use monadic actions in…
bgamari
  • 5,265
  • 1
  • 16
  • 21
53
votes
1 answer

'Repa' performance for planetary simulation

I have written a simulation of the outer planets of the solar system using the Euler symplectic method and implemented this a) using repa and b) using yarr. yarr seems to perform about x30 quicker than repa. Given this, I didn't even try to use…
idontgetoutmuch
  • 1,613
  • 11
  • 17
31
votes
3 answers

Best way of "looping over a 2-D array", using Repa

I find the array library Repa for Haskell very interesting, and wanted to make a simple program, to try to understand how to use it. I also made a simple implementation using lists, which proved to be much faster. My main question is how I could…
imladris
  • 1,091
  • 10
  • 9
28
votes
1 answer

Idiomatic option pricing and risk using Repa parallel arrays

Suppose I want to price a call option using a finite difference method and repa then the following does the job: import Data.Array.Repa as Repa r, sigma, k, t, xMax, deltaX, deltaT :: Double m, n, p :: Int r = 0.05 sigma = 0.2 k = 50.0 t = 3.0 m =…
idontgetoutmuch
  • 1,613
  • 11
  • 17
25
votes
0 answers

many parallel applications of a sequential transform in repa

In Repa, I would like to apply a certain d-dimensional linear transform in parallel across the innermost dimension of my array, i.e., on all "column" vectors. In general, such a transformation can be expressed as a matrix M, and each entry of M*v is…
Chris Peikert
  • 433
  • 4
  • 8
21
votes
2 answers

How to use phase control of inlining in haskell?

Documentation says, Sometimes you want to control exactly when in GHC's pipeline the INLINE pragma is switched on. Why should I ever want this? (Except when I also use RULES pragma, in this case I may want to postpone inlining of the function in…
leventov
  • 12,780
  • 10
  • 60
  • 91
19
votes
1 answer

Poor performance with transpose and cumulative sum in Repa

I have developed a cumulative sum function as defined below in the Haskell library Repa. However, I have run into an issue when combining this function with the transpose operation. All 3 of the following operations take well under a…
nightski
  • 513
  • 2
  • 13
19
votes
1 answer

Repa arrays indexed by a bounded data type?

I want to achieve something similar to the bounded arrays in the standard array package but using repa arrays. What is the nice and clean way to achieve this? This is what I tried, but there must be a better way than wrapping everything in custom…
user1105045
  • 475
  • 3
  • 15
16
votes
1 answer

Do Accelerate and Repa have different use cases?

I've been playing around with Repa and Accelerate - they're both interesting, but I can't work out when I'd use one and when the other. Are they growing together, rivals, or just for different problems?
Mark Wotton
  • 622
  • 4
  • 11
15
votes
2 answers

Repa 3 performance and correct usage of 'now'

There is a basic monad question in here, unrelated to Repa, plus several Repa-specific questions. I am working on a library using Repa3. I am having trouble getting efficient parallel code. If I make my functions return delayed arrays, I get…
crockeea
  • 21,467
  • 10
  • 44
  • 93
12
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,722
  • 1
  • 11
  • 23
12
votes
1 answer

Removing "case" with duplicate branches from Haskell's Core

I have a piece of Haskell code that looks like this: fst . f $ (Z :. i `div` 2) Z and :. are taken from Repa library and are defined like this: data Z = Z deriving (Show, Read, Eq, Ord) infixl 3 :. data tail :. head = !tail :. !head deriving…
Jan Stolarek
  • 1,350
  • 9
  • 21
12
votes
2 answers

How can I help SpecConstr in GHC?

I'm using GHC 7.4.1 to try to compile a program that uses Repa. But partway through compilation, I'm running out of memory. With ghc -v, I can see that it's getting stuck in the SpecConstr phase. SpecConstr is one of GHC's Core-to-Core…
Chad Scherrer
  • 703
  • 3
  • 16
11
votes
0 answers

Repa vs Mutable vector performance

I have coded two implementations of an algorithm to calculate all the eigenvalues and eigenvectors of a symmetric matrix. One implementation uses the REPA library…
felipez
  • 1,144
  • 7
  • 19
11
votes
2 answers

What are the key differences between the Repa 2 and 3 APIs?

To be more specific, I have the following innocuous-looking little Repa 3 program: {-# LANGUAGE QuasiQuotes #-} import Prelude hiding (map, zipWith) import System.Environment (getArgs) import Data.Word (Word8) import Data.Array.Repa import…
1
2 3 4 5 6 7