@@ -15,7 +15,7 @@ open GraphBLAS.FSharp.Backend
15
15
[<AbstractClass>]
16
16
[<IterationCount( 100 ) >]
17
17
[<WarmupCount( 10 ) >]
18
- [<Config( typeof< Configs.Matrix2 >) >]
18
+ [<Config( typeof< Configs.Matrix >) >]
19
19
type Benchmarks < 'elem when 'elem : struct >(
20
20
buildFunToBenchmark,
21
21
converter: string -> 'elem,
@@ -24,11 +24,9 @@ type Benchmarks<'elem when 'elem : struct>(
24
24
25
25
let mutable funToBenchmark = None
26
26
27
- let mutable firstMatrix = Unchecked.defaultof< ClMatrix< 'elem>>
28
- let mutable secondMatrix = Unchecked.defaultof< ClMatrix< 'elem>>
27
+ let mutable matrix = Unchecked.defaultof< ClMatrix< 'elem>>
29
28
30
- let mutable firstMatrixHost = Unchecked.defaultof<_>
31
- let mutable secondMatrixHost = Unchecked.defaultof<_>
29
+ let mutable matrixHost = Unchecked.defaultof<_>
32
30
33
31
member val ResultMatrix = Unchecked.defaultof< ClMatrix.COO< 'elem> option> with get, set
34
32
@@ -38,7 +36,7 @@ type Benchmarks<'elem when 'elem : struct>(
38
36
[<ParamsSource( " InputMatrixProvider" ) >]
39
37
member val InputMatrixReader = Unchecked.defaultof< MtxReader> with get, set
40
38
41
- member this.OclContext : ClContext = ( fst this.OclContextInfo) .ClContext
39
+ member this.OclContext : ClContext = ( fst this.OclContextInfo) .ClContext
42
40
member this.WorkGroupSize = snd this.OclContextInfo
43
41
44
42
member this.Processor =
@@ -78,24 +76,21 @@ type Benchmarks<'elem when 'elem : struct>(
78
76
reader.ReadMatrix converter
79
77
80
78
member this.Mxm () =
81
- this.ResultMatrix <- this.FunToBenchmark this.Processor DeviceOnly firstMatrix secondMatrix
79
+ this.ResultMatrix <- this.FunToBenchmark this.Processor DeviceOnly matrix matrix
82
80
83
81
member this.ClearInputMatrices () =
84
- firstMatrix.Dispose this.Processor
85
- secondMatrix.Dispose this.Processor
82
+ matrix.Dispose this.Processor
86
83
87
84
member this.ClearResult () =
88
85
match this.ResultMatrix with
89
86
| Some matrix -> matrix.Dispose this.Processor
90
87
| None -> ()
91
88
92
89
member this.ReadMatrices () =
93
- firstMatrixHost <- this.ReadMatrix this.InputMatrixReader
94
- secondMatrixHost <- this.ReadMatrix this.InputMatrixReader
90
+ matrixHost <- this.ReadMatrix this.InputMatrixReader
95
91
96
92
member this.LoadMatricesToGPU () =
97
- firstMatrix <- buildMatrix this.OclContext firstMatrixHost
98
- secondMatrix <- buildMatrix this.OclContext secondMatrixHost
93
+ matrix <- buildMatrix this.OclContext matrixHost
99
94
100
95
abstract member GlobalSetup : unit -> unit
101
96
0 commit comments