-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nofib: add test for AccelerateHS/accelerate#123
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|