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.

104 questions
2
votes
0 answers

Multiplying matrices with repa

I'm playing around with writing a JPEG decoder in pure Haskell (a chance to learn repa for me!), and right now I'm working on the IDCT (which amounts to multiplying a bunch of 8×8 matrices by a fixed 8×8 matrix). The function idctBlocks at the end of…
0xd34df00d
  • 1,496
  • 1
  • 8
  • 17
2
votes
1 answer

How to implement correctly Foreign.Storable to create Vectors?

I have been working in a project that has been using lists to calculate artificial neural network operations. Now, I would like to transform that to Data.Vector to improve its efficiency. However, I have been having a trouble at the moment to…
Invoke
  • 215
  • 1
  • 10
2
votes
1 answer

Repa creation from ByteString

Initially I have a ByteString, which i then unpack and convert into Int16s, this part of the process takes relatively little time. I then go to convert the list of Int16s into a Repa array with the following line, Repa.fromListUnboxed (Z :.…
Dylan B.
  • 73
  • 6
2
votes
1 answer

Write to file, but overwrite it if it exists with DevIL and REPA

I am using the DevIL library to read and write images. The problems is that I want to overwrite the file if it already exists. Here is my code: (RGB v) <- runIL $ readImage "/foo/foo.png" let rotated = (computeS $ batman v) :: Array F DIM3…
Hamburguesa66
  • 87
  • 1
  • 7
2
votes
1 answer

Monadic QuickCheck test not working for arbitrary Repa array

I am trying to write tests for arbitrary Repa Arrays in Haskell. For some reason, the following snippet: import Test.QuickCheck import Test.QuickCheck.Monadic import Data.Array.Repa (Array, DIM2) prop_id :: Array U DIM2 Double -> Property prop_id…
ethanabrooks
  • 747
  • 8
  • 19
2
votes
2 answers

How to filter by predicate on index in Repa

I have two Repa arrays a1 and a2 and I would like to eliminate all the elements in a2 for which the corresponding index in a1 is above a certain threshold. For example: import qualified Data.Array.Repa as R -- for Repa import Data.Array.Repa (Z…
ethanabrooks
  • 747
  • 8
  • 19
2
votes
0 answers

Parallel calls to HMatrix (or FFI in general)

I am working with point clouds in haskell using the repa library (3 as well as 4). At least I am trying to. There are a few operations I need to do massively where parallelism really helps a lot. Most of these are simple linear algebra operations on…
Richard Vock
  • 1,286
  • 10
  • 23
2
votes
1 answer

Performance of DIM1 Repa Array vs Vector

I've written a program to process a large amount of data samples using Repa. Performance is key for this program. A large part of the operations require parallel maps/folds over a multi-dimensional arrays and Repa is perfect for this. However, there…
Thomas Vanhelden
  • 879
  • 8
  • 20
2
votes
1 answer

Reading samples, from a file, into an array

I've written a program that analyzes sample data that is contained an a file. Currently, my program reads the samples into a list and I perform the further analyzation/processing on the list of samples ([Float]). I'm not quite happy with the…
user7420876
2
votes
0 answers

Run iterateM_ a specific number of times (Haskell)(Repa)

I have a simulation where the result of each step is the input for the next step. The simulation itself uses the IO Monad (Repa:ComputeP) and I would like to write the result of each step to a file as it is running. The closest I can think of using…
user668074
  • 1,111
  • 10
  • 16
2
votes
1 answer

Repa's slices and shapes

I'm having some trouble grasping repa's Slice module, and specifically how its types and families are used with the slice function. I believe an answer to the following would clear things up for me. Suppose x has shape shapeOfList [m_0, m_1, …,…
gspr
  • 11,144
  • 3
  • 41
  • 74
2
votes
0 answers

Repa performance for simple numerical method

I have implemented the Euler symplectic method using repa. It is a pretty simple method. Sadly the performance I am getting is not as good as I would have hoped. The repa guys have been very helpful (Ben Lippmeier in particular) and I have followed…
idontgetoutmuch
  • 1,621
  • 11
  • 17
2
votes
1 answer

Architecture mismatch on repa-devil package on OS X

I'm having trouble using the repa-devil package, which I installed from cabal with cabal install repa-devil. For example, here is part of my ghci transcript: Prelude Data.Array.Repa.IO.DevIL> :m + Data.Array.Repa.IO.DevIL Prelude…
Eyal
  • 1,094
  • 10
  • 16
2
votes
1 answer

Does Repa specify its data's memory layout?

I can't see that Repa specifies memory layouts for the data in any of its "manifest representations". Is this specified somewhere? Of course I can find out through experimentation, but I'd rather know if the layout is official or prone to change at…
gspr
  • 11,144
  • 3
  • 41
  • 74
1
vote
1 answer

Get the Height and Width of an image

I'm very new to Haskell so I apologise if this is too basic, or if it makes very little sense. I'm trying to read an image; I can get it to a list of pixel data with the following code: data Pixel = Pixel { red :: Integer, green :: Integer, …
OliverRadini
  • 6,238
  • 1
  • 21
  • 46