Skip to content

Commit 6ee498e

Browse files
committed
refactor: config in ClArray.copy and replcate tests
1 parent 269806a commit 6ee498e

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

tests/GraphBLAS-sharp.Tests/Common/Copy.fs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ let wgSize = 32
1616

1717
let q = Context.defaultContext.Queue
1818

19-
let makeTest<'a when 'a: equality> copyFun (array: array<'a>) = // TODO()
19+
let config = Utils.defaultConfig
20+
21+
let makeTest<'a when 'a: equality> copyFun (array: array<'a>) =
2022
if array.Length > 0 then
2123
use clArray = context.CreateClArray array
2224

@@ -37,7 +39,7 @@ let makeTest<'a when 'a: equality> copyFun (array: array<'a>) = // TODO()
3739
let creatTest<'a when 'a: equality> =
3840
ClArray.copy context wgSize
3941
|> makeTest<'a>
40-
|> testProperty $"Correctness test on random %A{typeof<'a>} arrays"
42+
|> testPropertyWithConfig config $"Correctness test on random %A{typeof<'a>} arrays"
4143

4244
let testCases =
4345
q.Error.Add(fun e -> failwithf "%A" e)

tests/GraphBLAS-sharp.Tests/Common/Replicate.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ let q = Context.defaultContext.Queue
1616

1717
let workGroupSize = 32
1818

19+
let config = Utils.defaultConfig
20+
1921
let makeTest<'a when 'a: equality> replicateFun (array: array<'a>) i =
2022
if array.Length > 0 && i > 0 then
2123
use clArray = context.CreateClArray array
@@ -40,7 +42,7 @@ let makeTest<'a when 'a: equality> replicateFun (array: array<'a>) i =
4042
let createTest<'a when 'a: equality> =
4143
ClArray.replicate context workGroupSize
4244
|> makeTest<'a>
43-
|> testProperty $"Correctness test on random %A{typeof<'a>} arrays"
45+
|> testPropertyWithConfig config $"Correctness test on random %A{typeof<'a>} arrays"
4446

4547
let testCases =
4648
q.Error.Add(fun e -> failwithf "%A" e)

tests/GraphBLAS-sharp.Tests/Program.fs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ let algorithmsTests =
5555
let allTests =
5656
testList
5757
"All tests"
58-
[ commonTests
59-
matrixTests
60-
vectorTests
61-
algorithmsTests ]
58+
[ Common.Copy.tests
59+
Common.Replicate.tests ]
6260
|> testSequenced
6361

6462
[<EntryPoint>]

0 commit comments

Comments
 (0)