@@ -15,35 +15,6 @@ open GraphBLAS.FSharp.Objects.Matrix
1515open GraphBLAS.FSharp .Benchmarks .MatrixExtensions
1616open GraphBLAS.FSharp .Backend .Objects .ClContext
1717
18- type Config () =
19- inherit ManualConfig()
20-
21- do
22- base .AddColumn(
23- MatrixShapeColumn( " RowCount" , ( fun ( matrix , _ ) -> matrix.ReadMatrixShape() .RowCount)) :> IColumn,
24- MatrixShapeColumn( " ColumnCount" , ( fun ( matrix , _ ) -> matrix.ReadMatrixShape() .ColumnCount)) :> IColumn,
25- MatrixShapeColumn(
26- " NNZ" ,
27- fun ( matrix , _ ) ->
28- match matrix.Format with
29- | Coordinate -> matrix.ReadMatrixShape() .Nnz
30- | Array -> 0
31- )
32- :> IColumn,
33- MatrixShapeColumn(
34- " SqrNNZ" ,
35- fun ( _ , matrix ) ->
36- match matrix.Format with
37- | Coordinate -> matrix.ReadMatrixShape() .Nnz
38- | Array -> 0
39- )
40- :> IColumn,
41- TEPSColumn() :> IColumn,
42- StatisticColumn.Min,
43- StatisticColumn.Max
44- )
45- |> ignore
46-
4718[<AbstractClass>]
4819[<IterationCount( 100 ) >]
4920[<WarmupCount( 10 ) >]
@@ -109,7 +80,7 @@ type EWiseAddBenchmarks<'matrixT, 'elem when 'matrixT :> IDeviceMemObject and 'e
10980 reader.ReadMatrix converter
11081
11182 member this.EWiseAddition () =
112- this.ResultMatrix <- this.FunToBenchmark this.Processor firstMatrix secondMatrix
83+ this.ResultMatrix <- this.FunToBenchmark this.Processor HostInterop firstMatrix secondMatrix
11384
11485 member this.ClearInputMatrices () =
11586 ( firstMatrix :> IDeviceMemObject) .Dispose this.Processor
@@ -225,7 +196,7 @@ module M =
225196type EWiseAddBenchmarks4Float32COOWithoutDataTransfer () =
226197
227198 inherit EWiseAddBenchmarksWithoutDataTransfer< ClMatrix.COO< float32>, float32>(
228- ( fun context wgSize -> COOMatrix.elementwise context ArithmeticOperations.float32Sum wgSize HostInterop ),
199+ ( fun context wgSize -> COOMatrix.map2 context ArithmeticOperations.float32Sum wgSize),
229200 float32,
230201 ( fun _ -> Utils.nextSingle ( System.Random())),
231202 Matrix.ToBackendCOO
@@ -237,7 +208,7 @@ type EWiseAddBenchmarks4Float32COOWithoutDataTransfer() =
237208type EWiseAddBenchmarks4Float32COOWithDataTransfer () =
238209
239210 inherit EWiseAddBenchmarksWithDataTransfer< ClMatrix.COO< float32>, float32>(
240- ( fun context wgSize -> COOMatrix.elementwise context ArithmeticOperations.float32Sum wgSize HostInterop ),
211+ ( fun context wgSize -> COOMatrix.map2 context ArithmeticOperations.float32Sum wgSize),
241212 float32,
242213 ( fun _ -> Utils.nextSingle ( System.Random())),
243214 Matrix.ToBackendCOO< float32>,
@@ -251,7 +222,7 @@ type EWiseAddBenchmarks4Float32COOWithDataTransfer() =
251222type EWiseAddBenchmarks4BoolCOOWithoutDataTransfer () =
252223
253224 inherit EWiseAddBenchmarksWithoutDataTransfer< ClMatrix.COO< bool>, bool>(
254- ( fun context wgSize -> COOMatrix.elementwise context ArithmeticOperations.boolSum wgSize HostInterop ),
225+ ( fun context wgSize -> COOMatrix.map2 context ArithmeticOperations.boolSum wgSize),
255226 ( fun _ -> true ),
256227 ( fun _ -> true ),
257228 Matrix.ToBackendCOO< bool>
@@ -264,7 +235,7 @@ type EWiseAddBenchmarks4BoolCOOWithoutDataTransfer() =
264235type EWiseAddBenchmarks4Float32CSRWithoutDataTransfer () =
265236
266237 inherit EWiseAddBenchmarksWithoutDataTransfer< ClMatrix.CSR< float32>, float32>(
267- ( fun context wgSize -> CSRMatrix.elementwise context ArithmeticOperations.float32Sum wgSize HostInterop ),
238+ ( fun context wgSize -> CSRMatrix.map2 context ArithmeticOperations.float32Sum wgSize),
268239 float32,
269240 ( fun _ -> Utils.nextSingle ( System.Random())),
270241 Matrix.ToBackendCSR
@@ -277,7 +248,7 @@ type EWiseAddBenchmarks4Float32CSRWithoutDataTransfer() =
277248type EWiseAddBenchmarks4BoolCSRWithoutDataTransfer () =
278249
279250 inherit EWiseAddBenchmarksWithoutDataTransfer< ClMatrix.CSR< bool>, bool>(
280- ( fun context wgSize -> CSRMatrix.elementwise context ArithmeticOperations.boolSum wgSize HostInterop ),
251+ ( fun context wgSize -> CSRMatrix.map2 context ArithmeticOperations.boolSum wgSize),
281252 ( fun _ -> true ),
282253 ( fun _ -> true ),
283254 Matrix.ToBackendCSR
@@ -291,7 +262,7 @@ type EWiseAddBenchmarks4BoolCSRWithoutDataTransfer() =
291262type EWiseAddAtLeastOneBenchmarks4BoolCOOWithoutDataTransfer () =
292263
293264 inherit EWiseAddBenchmarksWithoutDataTransfer< ClMatrix.COO< bool>, bool>(
294- ( fun context wgSize -> COOMatrix.elementwiseAtLeastOne context ArithmeticOperations.boolSumAtLeastOne wgSize HostInterop ),
265+ ( fun context wgSize -> COOMatrix.map2AtLeastOne context ArithmeticOperations.boolSumAtLeastOne wgSize),
295266 ( fun _ -> true ),
296267 ( fun _ -> true ),
297268 Matrix.ToBackendCOO< bool>
@@ -303,7 +274,7 @@ type EWiseAddAtLeastOneBenchmarks4BoolCOOWithoutDataTransfer() =
303274type EWiseAddAtLeastOneBenchmarks4BoolCSRWithoutDataTransfer () =
304275
305276 inherit EWiseAddBenchmarksWithoutDataTransfer< ClMatrix.CSR< bool>, bool>(
306- ( fun context wgSize -> CSRMatrix.elementwiseAtLeastOne context ArithmeticOperations.boolSumAtLeastOne wgSize HostInterop ),
277+ ( fun context wgSize -> CSRMatrix.map2AtLeastOne context ArithmeticOperations.boolSumAtLeastOne wgSize),
307278 ( fun _ -> true ),
308279 ( fun _ -> true ),
309280 Matrix.ToBackendCSR
@@ -315,7 +286,7 @@ type EWiseAddAtLeastOneBenchmarks4BoolCSRWithoutDataTransfer() =
315286type EWiseAddAtLeastOneBenchmarks4Float32COOWithoutDataTransfer () =
316287
317288 inherit EWiseAddBenchmarksWithoutDataTransfer< ClMatrix.COO< float32>, float32>(
318- ( fun context wgSize -> COOMatrix.elementwiseAtLeastOne context ArithmeticOperations.float32SumAtLeastOne wgSize HostInterop ),
289+ ( fun context wgSize -> COOMatrix.map2AtLeastOne context ArithmeticOperations.float32SumAtLeastOne wgSize),
319290 float32,
320291 ( fun _ -> Utils.nextSingle ( System.Random())),
321292 Matrix.ToBackendCOO< float32>
@@ -327,7 +298,7 @@ type EWiseAddAtLeastOneBenchmarks4Float32COOWithoutDataTransfer() =
327298type EWiseAddAtLeastOneBenchmarks4Float32CSRWithoutDataTransfer () =
328299
329300 inherit EWiseAddBenchmarksWithoutDataTransfer< ClMatrix.CSR< float32>, float32>(
330- ( fun context wgSize -> CSRMatrix.elementwiseAtLeastOne context ArithmeticOperations.float32SumAtLeastOne wgSize HostInterop ),
301+ ( fun context wgSize -> CSRMatrix.map2AtLeastOne context ArithmeticOperations.float32SumAtLeastOne wgSize),
331302 float32,
332303 ( fun _ -> Utils.nextSingle ( System.Random())),
333304 Matrix.ToBackendCSR< float32>
0 commit comments