File tree 10 files changed +33
-14
lines changed
10 files changed +33
-14
lines changed Original file line number Diff line number Diff line change 4
4
:m - ArrayFire
5
5
import qualified ArrayFire as A
6
6
:set -laf
7
+ :set -isrc:test
Original file line number Diff line number Diff line change 5
5
* ~
6
6
/ctags
7
7
cabal.project.local
8
- tags
8
+ tags
9
+ /.stack-work /
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.0
1
2
name : arrayfire
2
- version : 0.6 .0.0
3
+ version : 0.7 .0.0
3
4
synopsis : Haskell bindings to the ArrayFire general-purpose GPU library
4
5
homepage : https://github.com/arrayfire/arrayfire-haskell
5
- license : BSD3
6
+ license : BSD-3-Clause
6
7
license-file : LICENSE
7
8
author : David Johnson
8
9
maintainer : djohnson.m@gmail.com
9
- copyright : David Johnson (c) 2018-2020
10
+ copyright : David Johnson (c) 2018-2023
10
11
category : Math
11
12
build-type : Custom
12
13
extra-source-files : CHANGELOG.md
13
- cabal-version : >= 1.10
14
14
description : High-level Haskell bindings to the ArrayFire General-purpose GPU library
15
15
.
16
16
<<https://user-images.githubusercontent.com/875324/59819388-9ff83f00-92f5-11e9-9ac0-51eef200c716.png>>
@@ -75,8 +75,8 @@ library
75
75
ArrayFire.Internal.Types
76
76
ArrayFire.Internal.Util
77
77
ArrayFire.Internal.Vision
78
- build-tools :
79
- hsc2hs
78
+ build-tool-depends :
79
+ hsc2hs :hsc2hs
80
80
extra-libraries :
81
81
af
82
82
c-sources :
Original file line number Diff line number Diff line change 3
3
let
4
4
pkg = pkgs . haskellPackages . callCabal2nix "arrayfire" ./. {
5
5
af = null ;
6
- quickcheck-classes = pkgs . haskellPackages . quickcheck-classes_0_6_4_0 ;
7
6
} ;
8
7
in
9
8
pkg
Original file line number Diff line number Diff line change 11
11
${ pkgs . haskellPackages . ghcid . bin } /bin/ghcid -c 'cabal v1-repl lib:arrayfire'
12
12
};
13
13
function test-runner () {
14
- ${ pkgs . ag } /bin/ag -l | \
14
+ ${ pkgs . silver-searcher } /bin/ag -l | \
15
15
${ pkgs . entr } /bin/entr sh -c \
16
16
'cabal v1-configure --enable-tests && \
17
17
cabal v1-build test && dist/build/test/test'
18
18
}
19
19
function doctest-runner () {
20
- ${ pkgs . ag } /bin/ag -l | \
20
+ ${ pkgs . silver-searcher } /bin/ag -l | \
21
21
${ pkgs . entr } /bin/entr sh -c \
22
22
'cabal v1-configure --enable-tests && \
23
23
cabal v1-build doctests && dist/build/doctests/doctests src/ArrayFire/Algorithm.hs'
Original file line number Diff line number Diff line change
1
+ resolver :
2
+ url : https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/25.yaml
3
+
4
+ packages :
5
+ - .
Original file line number Diff line number Diff line change
1
+ # This file was autogenerated by Stack.
2
+ # You should not edit this file by hand.
3
+ # For more information, please see the documentation at:
4
+ # https://docs.haskellstack.org/en/stable/lock_files
5
+
6
+ packages: []
7
+ snapshots:
8
+ - completed:
9
+ size: 619403
10
+ url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/25.yaml
11
+ sha256: 1ecad1f0bd2c27de88dbff6572446cfdf647c615d58a7e2e2085c6b7dfc04176
12
+ original:
13
+ url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/25.yaml
Original file line number Diff line number Diff line change 63
63
A. product (A. vector @ Double 10 [1 .. ]) 0 `shouldBe` 3628800.0
64
64
A. product (A. vector @ (A. Complex Double ) 10 (repeat (1 A. :+ 1 ))) 0 `shouldBe` A. scalar (0.0 A. :+ 32.0 )
65
65
A. product (A. vector @ (A. Complex Float ) 10 (repeat (1 A. :+ 1 ))) 0 `shouldBe` A. scalar (0.0 A. :+ 32.0 )
66
- A. product (A. vector @ A. CBool 10 (repeat 1 )) 0 `shouldBe` 10 -- FIXME: This is a bug, should be 0
66
+ A. product (A. vector @ A. CBool 10 (repeat 1 )) 0 `shouldBe` 1 -- FIXED in 3.8.2, vector product along 0-axis is 1 for vector size 10 of all 1's.
67
67
A. product (A. vector @ A. CBool 10 (repeat 0 )) 0 `shouldBe` 0
68
68
it " Should product a default value to replace NaN" $ do
69
69
A. productNaN (A. vector @ Float 10 [1 .. ]) 0 1.0 `shouldBe` 3628800.0
@@ -100,7 +100,7 @@ spec =
100
100
it " Should get sum all elements" $ do
101
101
A. sumAll (A. vector @ Int 5 (repeat 2 )) `shouldBe` (10 ,0 )
102
102
A. sumAll (A. vector @ Double 5 (repeat 2 )) `shouldBe` (10.0 ,0 )
103
- -- A.sumAll (A.vector @A.CBool 3800 (repeat 1)) `shouldBe` (3800,0) -- causes strange behavior
103
+ A. sumAll (A. vector @ A. CBool 3800 (repeat 1 )) `shouldBe` (3800 ,0 )
104
104
A. sumAll (A. vector @ (A. Complex Double ) 5 (repeat (2 A. :+ 0 ))) `shouldBe` (10.0 ,0 )
105
105
it " Should get sum all elements" $ do
106
106
A. sumNaNAll (A. vector @ Double 2 [10 , acos 2 ]) 1 `shouldBe` (11.0 ,0 )
Original file line number Diff line number Diff line change 20
20
it " Should find the variance" $ do
21
21
var (vector @ Double 8 [1 .. 8 ]) False 0
22
22
`shouldBe`
23
- 6.0
23
+ 5.25
24
24
it " Should find the weighted variance" $ do
25
25
varWeighted (vector @ Double 8 [1 .. ]) (vector @ Double 8 (repeat 1 )) 0
26
26
`shouldBe`
Original file line number Diff line number Diff line change 31
31
A. getSizeOf (Proxy @ (Complex Double )) `shouldBe` 16
32
32
it " Should get version" $ do
33
33
x <- A. getVersion
34
- x `shouldBe` (3 ,6 , 4 )
34
+ x `shouldBe` (3 ,8 , 2 )
35
35
it " Should get revision" $ do
36
36
x <- A. getRevision
37
37
x `shouldSatisfy` (not . null )
You can’t perform that action at this time.
0 commit comments