Skip to content

Commit

Permalink
nofib: add test for AccelerateHS/accelerate#93
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcdonell committed Sep 7, 2014
1 parent aa90299 commit 9186c0a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions accelerate-examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Executable accelerate-nofib
Test.Imaginary.SASUM
Test.Imaginary.SAXPY
Test.Issues
Test.Issues.Issue93
Test.Issues.Issue114
Test.Issues.Issue137
Test.Issues.Issue168
Expand Down
4 changes: 3 additions & 1 deletion examples/nofib/Test/Issues.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Test.Issues (
import Config

import Test.Framework
import Test.Issues.Issue93
import Test.Issues.Issue114
import Test.Issues.Issue137
import Test.Issues.Issue168
Expand All @@ -20,7 +21,8 @@ test_issues :: Config -> Test
test_issues conf =
testGroup "issues"
[
test_issue114 conf
test_issue93 conf
, test_issue114 conf
, test_issue137 conf
, test_issue168 conf
, test_issue184 conf
Expand Down
30 changes: 30 additions & 0 deletions examples/nofib/Test/Issues/Issue93.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

module Test.Issues.Issue93 (test_issue93)
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_issue93 :: Config -> Test
test_issue93 conf =
testCase "93" (assertEqual xs $ run backend test1)
where
backend = get configBackend conf


xs :: Array DIM2 Int
xs = fromList (Z :. 1 :. 1) [5]

test1 :: Acc (Array DIM2 Int)
test1 = permute (\c _ -> c) (fill (shape xs') (constant 0)) id xs'
where
xs' = use xs

0 comments on commit 9186c0a

Please sign in to comment.