diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d7afc455 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: Continuous Integration + +on: + push: + +jobs: + continuous-integration: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ghc-version: + - "8.10.7" + - "9.0.2" + - "9.2.8" + - "9.4.8" + - "9.6.6" + - "9.8.2" + - "9.10.1" + + steps: + - uses: actions/checkout@v4 + + - name: Install cabal/ghc + uses: haskell-actions/setup@v2 + id: setup-haskell + with: + ghc-version: ${{ matrix.ghc-version }} + cabal-version: '3.10.3.0' + + - name: Generate freeze file + run: | + cabal update + cabal configure --disable-optimization --enable-tests + cabal freeze + + - name: Cache cabal work + uses: actions/cache@v4 + with: + path: | + dist-newstyle + ${{ steps.setup-haskell.outputs.cabal-store }} + key: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze', 'cabal.project.local') }}-cabal-install + + - name: Build dependencies + run: | + cabal build all --only-dependencies + + - name: Build packages + run: | + cabal build all + + - name: Run tests + run: | + cabal test all diff --git a/.gitignore b/.gitignore index cf42991c..64220442 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,24 @@ .stack-work /stack.yaml +dist +dist-* +cabal-dev +*.o +*.hi +*.hie +*.chi +*.chs.h +*.dyn_o +*.dyn_hi +.hpc +.hsenv +.cabal-sandbox/ +cabal.sandbox.config +*.prof +*.aux +*.hp +*.eventlog +cabal.project.local +cabal.project.local~ +.HTF/ +.ghc.environment.* \ No newline at end of file diff --git a/README.md b/README.md index 73f9e17b..fa5e2173 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ repa ==== -[![Build Status](https://travis-ci.org/tmcdonell/repa.svg?branch=master)](https://travis-ci.org/tmcdonell/repa) - 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. diff --git a/cabal.project b/cabal.project new file mode 100644 index 00000000..d84d6536 --- /dev/null +++ b/cabal.project @@ -0,0 +1,22 @@ +packages: repa/repa.cabal + repa-algorithms/repa-algorithms.cabal + repa-examples/repa-examples.cabal + repa-io/repa-io.cabal + + -- Packages below are ignored until they can be updated + -- to support newer GHCs + -- repa-convert/repa-convert.cabal + -- repa-eval/repa-eval.cabal + -- repa-scalar/repa-scalar.cabal + -- repa-stream/repa-stream.cabal + + -- We ignore some packages which depend on repa-array rather than repa + -- repa-array/repa-array.cabal + -- repa-flow/repa-flow.cabal + -- repa-query/repa-query.cabal + -- repa-tools/repa-tools.cabal + -- repa-store/repa-store.cabal + -- repa-machine/repa-machine.cabal + + +minimize-conflict-set: true \ No newline at end of file diff --git a/repa-algorithms/repa-algorithms.cabal b/repa-algorithms/repa-algorithms.cabal index 695e707e..2663ffc2 100644 --- a/repa-algorithms/repa-algorithms.cabal +++ b/repa-algorithms/repa-algorithms.cabal @@ -18,9 +18,9 @@ Synopsis: Library Build-Depends: - base >= 4.8 && < 5 - , vector >= 0.11 && < 0.13 - , repa == 3.4.1.* + base >= 4.8 && < 4.21 + , vector >= 0.11 && < 0.14 + , repa >= 3.4 && <3.5 ghc-options: -Wall diff --git a/repa-examples/repa-examples.cabal b/repa-examples/repa-examples.cabal index fa46259f..9d47fa64 100644 --- a/repa-examples/repa-examples.cabal +++ b/repa-examples/repa-examples.cabal @@ -5,7 +5,7 @@ License-file: LICENSE Author: The DPH Team Maintainer: Ben Lippmeier Build-Type: Simple -Cabal-Version: >=1.6 +Cabal-Version: >=1.10 Stability: experimental Category: Data Structures Homepage: http://repa.ouroborus.net @@ -25,9 +25,11 @@ Flag llvm Executable repa-canny Build-depends: - base >= 4.8 && < 4.15 - , repa == 3.4.1.* - , repa-algorithms == 3.4.1.* + base >= 4.8 && < 4.21 + , repa >= 3.4 && < 3.5 + , repa-algorithms >= 3.4 && < 3.5 + , repa-io >= 3.4 && < 3.5 + , vector Main-is: examples/Canny/src-repa/Main.hs hs-source-dirs: examples/Canny/src-repa . @@ -46,11 +48,11 @@ Executable repa-canny Executable repa-mmult Build-depends: - base >= 4.8 && < 4.15 + base >= 4.8 && < 4.21 , random == 1.1.* - , repa == 3.4.1.* - , repa-algorithms == 3.4.1.* - , repa-io == 3.4.1.* + , repa >= 3.4 && < 3.5 + , repa-algorithms >= 3.4 && < 3.5 + , repa-io >= 3.4 && < 3.5 Main-is: examples/MMult/src-repa/Main.hs other-modules: Solver @@ -72,9 +74,10 @@ Executable repa-mmult Executable repa-laplace Build-depends: - base >= 4.8 && < 4.15 - , repa == 3.4.1.* - , repa-io == 3.4.1.* + base >= 4.8 && < 4.21 + , repa >= 3.4 && < 3.5 + , repa-algorithms >= 3.4 && < 3.5 + , repa-io >= 3.4 && < 3.5 , template-haskell Main-is: examples/Laplace/src-repa/Main.hs @@ -95,10 +98,10 @@ Executable repa-laplace Executable repa-fft2d Build-depends: - base >= 4.8 && < 4.15 - , repa == 3.4.1.* - , repa-algorithms == 3.4.1.* - , repa-io == 3.4.1.* + base >= 4.8 && < 4.21 + , repa >= 3.4 && < 3.5 + , repa-algorithms >= 3.4 && < 3.5 + , repa-io >= 3.4 && < 3.5 Main-is: examples/FFT/FFT2d/src-repa/Main.hs hs-source-dirs: examples/FFT/FFT2d/src-repa . @@ -119,10 +122,10 @@ Executable repa-fft2d Executable repa-fft2d-highpass Build-depends: - base >= 4.8 && < 4.15 - , repa == 3.4.1.* - , repa-algorithms == 3.4.1.* - , repa-io == 3.4.1.* + base >= 4.8 && < 4.21 + , repa >= 3.4 && < 3.5 + , repa-algorithms >= 3.4 && < 3.5 + , repa-io >= 3.4 && < 3.5 Main-is: examples/FFT/HighPass2d/src-repa/Main.hs hs-source-dirs: examples/FFT/HighPass2d/src-repa . @@ -143,9 +146,10 @@ Executable repa-fft2d-highpass Executable repa-fft3d-highpass Build-depends: - base >= 4.8 && < 4.15 - , repa == 3.4.1.* - , repa-algorithms == 3.4.1.* + base >= 4.8 && < 4.21 + , repa >= 3.4 && < 3.5 + , repa-algorithms >= 3.4 && < 3.5 + , repa-io >= 3.4 && < 3.5 Main-is: examples/FFT/HighPass3d/src-repa/Main.hs hs-source-dirs: examples/FFT/HighPass3d/src-repa . @@ -166,10 +170,11 @@ Executable repa-fft3d-highpass Executable repa-blur Build-depends: - base >= 4.8 && < 4.15 - , repa == 3.4.1.* - , repa-algorithms == 3.4.1.* - , vector >= 0.11 && < 0.13 + base >= 4.8 && < 4.21 + , repa >= 3.4 && < 3.5 + , repa-algorithms >= 3.4 && < 3.5 + , repa-io >= 3.4 && < 3.5 + , vector >= 0.11 && < 0.14 Main-is: examples/Blur/src-repa/Main.hs hs-source-dirs: examples/Blur/src-repa . @@ -190,9 +195,10 @@ Executable repa-blur Executable repa-sobel Build-depends: - base >= 4.8 && < 4.15 - , repa == 3.4.1.* - , repa-algorithms == 3.4.1.* + base >= 4.8 && < 4.21 + , repa >= 3.4 && < 3.5 + , repa-algorithms >= 3.4 && < 3.5 + , repa-io >= 3.4 && < 3.5 Main-is: examples/Sobel/src-repa/Main.hs other-modules: Solver @@ -214,9 +220,10 @@ Executable repa-sobel Executable repa-volume Build-depends: - base >= 4.8 && < 4.15 - , repa == 3.4.1.* - , repa-io == 3.4.1.* + base >= 4.8 && < 4.21 + , repa >= 3.4 && < 3.5 + , repa-algorithms >= 3.4 && < 3.5 + , repa-io >= 3.4 && < 3.5 Main-is: examples/Volume/Main.hs ghc-options: @@ -236,9 +243,9 @@ Executable repa-volume Executable repa-unit-test Build-depends: - base >= 4.8 && < 4.15 - , repa == 3.4.1.* - , QuickCheck >= 2.8 && < 2.14 + base >= 4.8 && < 4.21 + , repa >= 3.4 && < 3.5 + , QuickCheck >= 2.8 && < 2.16 Main-is: examples/UnitTesting/UnitTesting.hs hs-source-dirs: examples/UnitTesting . diff --git a/repa-io/repa-io.cabal b/repa-io/repa-io.cabal index 30a6ddd2..79c735e1 100644 --- a/repa-io/repa-io.cabal +++ b/repa-io/repa-io.cabal @@ -18,13 +18,13 @@ Synopsis: Library Build-Depends: - base >= 4.8 && < 5 + base >= 4.8 && < 4.21 , binary >= 0.7 && < 0.9 - , bmp == 1.2.* - , bytestring >= 0.10 && < 0.12 + , bmp >= 1.2 && <1.3 + , bytestring >= 0.10 && < 0.13 , old-time == 1.1.* - , repa == 3.4.* - , vector >= 0.11 && < 0.13 + , repa >= 3.4 && <3.5 + , vector >= 0.11 && < 0.14 ghc-options: -O2 diff --git a/repa/Data/Array/Repa/Eval/Elt.hs b/repa/Data/Array/Repa/Eval/Elt.hs index f944739f..84f90d4f 100644 --- a/repa/Data/Array/Repa/Eval/Elt.hs +++ b/repa/Data/Array/Repa/Eval/Elt.hs @@ -4,7 +4,6 @@ module Data.Array.Repa.Eval.Elt (Elt (..)) where -import GHC.Prim import GHC.Exts import GHC.Types import GHC.Word @@ -125,7 +124,7 @@ instance Elt Bool where -- Floating ------------------------------------------------------------------- instance Elt Float where {-# INLINE touch #-} - touch (F# f) + touch f = IO (\state -> case touch# f state of state' -> (# state', () #)) @@ -138,7 +137,7 @@ instance Elt Float where instance Elt Double where {-# INLINE touch #-} - touch (D# d) + touch d = IO (\state -> case touch# d state of state' -> (# state', () #)) @@ -152,7 +151,7 @@ instance Elt Double where -- Int ------------------------------------------------------------------------ instance Elt Int where {-# INLINE touch #-} - touch (I# i) + touch i = IO (\state -> case touch# i state of state' -> (# state', () #)) @@ -164,7 +163,7 @@ instance Elt Int where instance Elt Int8 where {-# INLINE touch #-} - touch (I8# w) + touch w = IO (\state -> case touch# w state of state' -> (# state', () #)) @@ -177,7 +176,7 @@ instance Elt Int8 where instance Elt Int16 where {-# INLINE touch #-} - touch (I16# w) + touch w = IO (\state -> case touch# w state of state' -> (# state', () #)) @@ -190,7 +189,7 @@ instance Elt Int16 where instance Elt Int32 where {-# INLINE touch #-} - touch (I32# w) + touch w = IO (\state -> case touch# w state of state' -> (# state', () #)) @@ -203,7 +202,7 @@ instance Elt Int32 where instance Elt Int64 where {-# INLINE touch #-} - touch (I64# w) + touch w = IO (\state -> case touch# w state of state' -> (# state', () #)) @@ -217,7 +216,7 @@ instance Elt Int64 where -- Word ----------------------------------------------------------------------- instance Elt Word where {-# INLINE touch #-} - touch (W# i) + touch i = IO (\state -> case touch# i state of state' -> (# state', () #)) @@ -230,7 +229,7 @@ instance Elt Word where instance Elt Word8 where {-# INLINE touch #-} - touch (W8# w) + touch w = IO (\state -> case touch# w state of state' -> (# state', () #)) @@ -243,7 +242,7 @@ instance Elt Word8 where instance Elt Word16 where {-# INLINE touch #-} - touch (W16# w) + touch w = IO (\state -> case touch# w state of state' -> (# state', () #)) @@ -256,7 +255,7 @@ instance Elt Word16 where instance Elt Word32 where {-# INLINE touch #-} - touch (W32# w) + touch w = IO (\state -> case touch# w state of state' -> (# state', () #)) @@ -269,7 +268,7 @@ instance Elt Word32 where instance Elt Word64 where {-# INLINE touch #-} - touch (W64# w) + touch w = IO (\state -> case touch# w state of state' -> (# state', () #)) diff --git a/repa/repa.cabal b/repa/repa.cabal index 83872733..8d5c4320 100644 --- a/repa/repa.cabal +++ b/repa/repa.cabal @@ -5,7 +5,7 @@ License-file: LICENSE Author: The DPH Team Maintainer: Ben Lippmeier Build-Type: Simple -Cabal-Version: >=1.6 +Cabal-Version: >=1.10 Stability: experimental Category: Data Structures Homepage: http://repa.ouroborus.net @@ -25,12 +25,12 @@ Flag no-template-haskell Library Build-Depends: - base >= 4.8 && < 4.17 + base >= 4.8 && < 4.21 , template-haskell , ghc-prim - , vector >= 0.11 && < 0.13 - , bytestring >= 0.10 && < 0.12 - , QuickCheck >= 2.8 && < 2.15 + , vector >= 0.11 && < 0.14 + , bytestring >= 0.10 && < 0.13 + , QuickCheck >= 2.8 && < 2.16 ghc-options: -Wall