Skip to content

Commit 06be7e7

Browse files
committed
refactor: Naming, Generators
1 parent 627e8c5 commit 06be7e7

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

src/GraphBLAS-sharp.Backend/Common/ClArray.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,7 @@ module ClArray =
779779
if index < 0 || index >= array.Length then
780780
failwith "Index out of range"
781781

782-
let value =
783-
clContext.CreateClCell value
782+
let value = clContext.CreateClCell value
784783

785784
let kernel = program.GetKernel()
786785

tests/GraphBLAS-sharp.Tests/Backend/Common/ClArray/Item.fs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ let context = Context.defaultContext.ClContext
1212

1313
let processor = Context.defaultContext.Queue
1414

15-
let config = { Utils.defaultConfig with arbitrary = [ typeof<Generators.ClArray.Item> ] }
15+
let config =
16+
{ Utils.defaultConfig with
17+
arbitrary = [ typeof<Generators.ClArray.Item> ] }
1618

1719
let makeTest<'a when 'a: equality> testFun (array: 'a [], position) =
1820

@@ -39,7 +41,7 @@ let tests =
3941
[ createTest<int>
4042

4143
if Utils.isFloat64Available context.ClDevice then
42-
createTest<float>
44+
createTest<float>
4345

4446
createTest<float32>
4547
createTest<bool> ]

tests/GraphBLAS-sharp.Tests/Backend/Common/ClArray/Set.fs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ let context = Context.defaultContext.ClContext
1111

1212
let processor = Context.defaultContext.Queue
1313

14-
let config = { Utils.defaultConfig with arbitrary = [typeof<Generators.ClArray.Set>]}
14+
let config =
15+
{ Utils.defaultConfig with
16+
arbitrary = [ typeof<Generators.ClArray.Set> ] }
1517

16-
let makeTest<'a when 'a : equality> testFun (array: 'a [], position, value: 'a) =
18+
let makeTest<'a when 'a: equality> testFun (array: 'a [], position, value: 'a) =
1719

1820
if array.Length > 0 then
1921

@@ -27,7 +29,7 @@ let makeTest<'a when 'a : equality> testFun (array: 'a [], position, value: 'a)
2729
"Results must be the same"
2830
|> Utils.compareArrays (=) actual array
2931

30-
let createTest<'a when 'a : equality> =
32+
let createTest<'a when 'a: equality> =
3133
ClArray.set context Utils.defaultWorkGroupSize
3234
|> makeTest<'a>
3335
|> testPropertyWithConfig config $"test on %A{typeof<'a>}"
@@ -36,9 +38,8 @@ let tests =
3638
[ createTest<int>
3739

3840
if Utils.isFloat64Available context.ClDevice then
39-
createTest<float>
41+
createTest<float>
4042

4143
createTest<float32>
4244
createTest<bool> ]
4345
|> testList "Set"
44-

tests/GraphBLAS-sharp.Tests/Generators.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module Generators =
3737

3838
let genericSparseGenerator zero valuesGen handler =
3939
let maxSparsity = 100
40-
let sparsityGen = Gen.choose (1, 10)
40+
let sparsityGen = Gen.choose (1, maxSparsity)
4141

4242
let genWithSparsity sparseValuesGenProvider =
4343
gen {

tests/GraphBLAS-sharp.Tests/GraphBLAS-sharp.Tests.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<Compile Include="Backend/Vector/SpMV.fs" />
6363
<Compile Include="Backend/Vector/ZeroCreate.fs" />
6464
<Compile Include="Backend/Vector/Merge.fs" />
65-
<Compile Include="Host/Matrix/FromaArray2D.fs" />
65+
<Compile Include="Host/Matrix/FromArray2D.fs" />
6666
<Compile Include="Host/Matrix/Convert.fs" />
6767
<Compile Include="Host/IO/MtxReader.fs" />
6868
<Content Include="Host/IO/Dataset/testMatrix.mtx" />

0 commit comments

Comments
 (0)