Skip to content

Commit 29a93c4

Browse files
committed
refactor: Utils.defaultWorkGroupSize
1 parent f0ec463 commit 29a93c4

20 files changed

Lines changed: 28 additions & 26 deletions

File tree

tests/GraphBLAS-sharp.Tests/Algorithms/BFS.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let testFixtures (testContext: TestContext) =
1616
[ let config = Utils.undirectedAlgoConfig
1717
let context = testContext.ClContext
1818
let queue = testContext.Queue
19-
let workGroupSize = 32
19+
let workGroupSize = Utils.defaultWorkGroupSize
2020

2121
let testName =
2222
sprintf "Test on %A" testContext.ClContext

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let config =
1616
{ Utils.defaultConfig with
1717
endSize = 1000000 }
1818

19-
let wgSize = 32
19+
let wgSize = Utils.defaultWorkGroupSize
2020

2121
let q = defaultContext.Queue
2222

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let logger = Log.create "ClArray.Copy.Tests"
1212

1313
let context = Context.defaultContext.ClContext
1414

15-
let wgSize = 32
15+
let wgSize = Utils.defaultWorkGroupSize
1616

1717
let q = Context.defaultContext.Queue
1818

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let q = defaultContext.Queue
1818

1919
let config = Utils.defaultConfig
2020

21-
let wgSize = 32
21+
let wgSize = Utils.defaultWorkGroupSize
2222

2323
let correctnessGenericTest<'a when 'a: struct and 'a: equality> isZero exists (array: 'a []) =
2424

@@ -66,4 +66,4 @@ let testFixtures =
6666
createTest<bool> (=) false ]
6767

6868
let tests =
69-
testList "Backend.Vector.containsNonZero tests" testFixtures
69+
testList "Common.ClArray.exists tests" testFixtures

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let context = Context.defaultContext.ClContext
1313

1414
let config = Utils.defaultConfig
1515

16-
let wgSize = 32
16+
let wgSize = Utils.defaultWorkGroupSize
1717

1818
let q = Context.defaultContext.Queue
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let context = Context.defaultContext.ClContext
1414

1515
let q = Context.defaultContext.Queue
1616

17-
let workGroupSize = 32
17+
let workGroupSize = Utils.defaultWorkGroupSize
1818

1919
let config = Utils.defaultConfig
2020

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let config =
1515
{ Tests.Utils.defaultConfig with
1616
endSize = 1000000 }
1717

18-
let wgSize = 32
18+
let wgSize = Tests.Utils.defaultWorkGroupSize
1919

2020
let q = defaultContext.Queue
2121

tests/GraphBLAS-sharp.Tests/Helpers.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ open GraphBLAS.FSharp.Backend.Objects
1313

1414
[<RequireQualifiedAccess>]
1515
module Utils =
16+
let defaultWorkGroupSize = 32
1617

1718
let defaultConfig =
1819
{ FsCheckConfig.defaultConfig with

tests/GraphBLAS-sharp.Tests/Matrix/Convert.fs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ open GraphBLAS.FSharp.Backend.Objects.ClContext
1515
let logger = Log.create "Convert.Tests"
1616

1717
let config = Utils.defaultConfig
18-
let wgSize = 32
18+
19+
let workGroupSize = Utils.defaultWorkGroupSize
1920

2021
let makeTest context q formatFrom formatTo convertFun isZero (array: 'a [,]) =
2122
let mtx =
@@ -51,15 +52,15 @@ let testFixtures formatTo =
5152

5253
match formatTo with
5354
| COO ->
54-
[ let convertFun = Matrix.toCOO context wgSize
55+
[ let convertFun = Matrix.toCOO context workGroupSize
5556

5657
Utils.listOfUnionCases<MatrixFormat>
5758
|> List.map
5859
(fun formatFrom ->
5960
makeTest context q formatFrom formatTo convertFun ((=) 0)
6061
|> testPropertyWithConfig config (getCorrectnessTestName "int" formatFrom))
6162

62-
let convertFun = Matrix.toCOO context wgSize
63+
let convertFun = Matrix.toCOO context workGroupSize
6364

6465
Utils.listOfUnionCases<MatrixFormat>
6566
|> List.map
@@ -68,15 +69,15 @@ let testFixtures formatTo =
6869
|> testPropertyWithConfig config (getCorrectnessTestName "bool" formatFrom)) ]
6970
|> List.concat
7071
| CSR ->
71-
[ let convertFun = Matrix.toCSR context wgSize
72+
[ let convertFun = Matrix.toCSR context workGroupSize
7273

7374
Utils.listOfUnionCases<MatrixFormat>
7475
|> List.map
7576
(fun formatFrom ->
7677
makeTest context q formatFrom formatTo convertFun ((=) 0)
7778
|> testPropertyWithConfig config (getCorrectnessTestName "int" formatFrom))
7879

79-
let convertFun = Matrix.toCSR context wgSize
80+
let convertFun = Matrix.toCSR context workGroupSize
8081

8182
Utils.listOfUnionCases<MatrixFormat>
8283
|> List.map
@@ -85,15 +86,15 @@ let testFixtures formatTo =
8586
|> testPropertyWithConfig config (getCorrectnessTestName "bool" formatFrom)) ]
8687
|> List.concat
8788
| CSC ->
88-
[ let convertFun = Matrix.toCSC context wgSize
89+
[ let convertFun = Matrix.toCSC context workGroupSize
8990

9091
Utils.listOfUnionCases<MatrixFormat>
9192
|> List.map
9293
(fun formatFrom ->
9394
makeTest context q formatFrom formatTo convertFun ((=) 0)
9495
|> testPropertyWithConfig config (getCorrectnessTestName "int" formatFrom))
9596

96-
let convertFun = Matrix.toCSC context wgSize
97+
let convertFun = Matrix.toCSC context workGroupSize
9798

9899
Utils.listOfUnionCases<MatrixFormat>
99100
|> List.map

tests/GraphBLAS-sharp.Tests/Matrix/Map2.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ open GraphBLAS.FSharp.Backend.Objects.ClContext
1818
let logger = Log.create "Map2.Tests"
1919

2020
let config = Utils.defaultConfig
21-
let wgSize = 32
21+
let wgSize = Utils.defaultWorkGroupSize
2222

2323
let getCorrectnessTestName case datatype =
2424
$"Correctness on %s{datatype}, %A{case}"

0 commit comments

Comments
 (0)