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
2
votes
1 answer

Haskell Repa-0.2.0.1 with vector-0.9

First off, I love repa and repa-devil but most of my libraries require vector >= 0.9. since we are on GHC 7.0.* we need to use repa-0.2.0.* but these have a hard dependency on vector >= 0.7 && < 0.8. I was able to get repa-0.2.0.* to compile with…
mxc
  • 749
  • 4
  • 10
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
  • 203
  • 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

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
  • 625
  • 8
  • 14
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
  • 625
  • 8
  • 14
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,014
  • 5
  • 16
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
  • 850
  • 6
  • 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
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
  • 10,367
  • 3
  • 38
  • 68
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,613
  • 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,104
  • 8
  • 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
  • 10,367
  • 3
  • 38
  • 68
1
vote
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…
1
vote
1 answer

REPA: computeS and computeP?

I am trying this REPA library, and i want to process an image in both ways, parallel and sequentially. I can read the image (with other library, DevIL) and process it with computeP (parallel). Here is the code (is from a example on the wiki of…
1
vote
1 answer

Variable inner types for wrapped Repa array

I'm attempting to write a thin wrapper around repa to provide extra constraints for some domain-specific work I'm doing. I have the type: newtype Tile p r a = Tile { _array :: Array r DIM2 a } where Array comes from repa. I'd like to hide the r…
Colin Woodbury
  • 1,629
  • 2
  • 14
  • 24