Skip to content

Commit

Permalink
nofib: add test for AccelerateHS/accelerate#123
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcdonell committed Sep 7, 2014
1 parent 5328789 commit 1864d35
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions accelerate-examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Executable accelerate-nofib
Test.Issues.Issue93
Test.Issues.Issue102
Test.Issues.Issue114
Test.Issues.Issue123
Test.Issues.Issue137
Test.Issues.Issue168
Test.Issues.Issue184
Expand Down
2 changes: 2 additions & 0 deletions examples/nofib/Test/Issues.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Test.Framework
import Test.Issues.Issue93
import Test.Issues.Issue102
import Test.Issues.Issue114
import Test.Issues.Issue123
import Test.Issues.Issue137
import Test.Issues.Issue168
import Test.Issues.Issue184
Expand All @@ -25,6 +26,7 @@ test_issues conf =
test_issue93 conf
, test_issue102 conf
, test_issue114 conf
, test_issue123 conf
, test_issue137 conf
, test_issue168 conf
, test_issue184 conf
Expand Down
29 changes: 29 additions & 0 deletions examples/nofib/Test/Issues/Issue123.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

module Test.Issues.Issue123 (test_issue123)
where

import Config
import ParseArgs
import Test.Base
import Test.Framework
import Test.Framework.Providers.HUnit

import Prelude as P
import Data.Array.Accelerate as A
import Data.Label


test_issue123 :: Config -> Test
test_issue123 conf =
testCase "123" (assertEqual ref1 $ run backend (test1 n))
where
backend = get configBackend conf
n = 100
ref1 = fromList Z [n]


test1 :: Int -> Acc (Scalar Int)
test1 n
= fold (+) 0
$ fill (constant (Z:.n)) 1

0 comments on commit 1864d35

Please sign in to comment.