Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f3ccf0b
CSR merge, no empty rows
kirillgarbar Jul 21, 2022
449e060
CSR merge, empty row case
kirillgarbar Jul 21, 2022
79802c3
getUniqueBitmap CSR
kirillgarbar Jul 21, 2022
c3ea68b
preparePositions CSR
kirillgarbar Jul 21, 2022
59f6c65
Set positions, elementwiseCSR
kirillgarbar Jul 21, 2022
aceb130
Add to fsproj
kirillgarbar Jul 21, 2022
798562f
Row sizes computing inside kernels
kirillgarbar Jul 27, 2022
c16714e
Work-group on each row (before rewriting merge)
kirillgarbar Jul 28, 2022
862f1e0
Work-group on each row, one block per row case is working
kirillgarbar Jul 31, 2022
b8192f6
Row pointers computing
kirillgarbar Aug 5, 2022
a2a3b17
Work-group on each row, all test cases passed
kirillgarbar Aug 6, 2022
247ba59
Brahma 2.0.1
kirillgarbar Aug 6, 2022
e2bfae9
isRowEnd bitmap and merge cleanup
kirillgarbar Aug 12, 2022
b3b245c
DCSR to CSR conversion, EWise passing all tests except float
kirillgarbar Aug 15, 2022
e213590
EWise fixes
kirillgarbar Aug 17, 2022
39cd6b1
Debug cleanup
kirillgarbar Aug 22, 2022
9594bb7
eWiseAdd for AtLeastOne CSR
kirillgarbar Aug 22, 2022
d457edd
EWiseAdd renamed to Elementwise
kirillgarbar Aug 22, 2022
9be27a0
Comments and minor fixes
kirillgarbar Aug 22, 2022
33348e0
CSR preparePositions fix
kirillgarbar Sep 10, 2022
d4ae372
Merge branch 'elementwise' into net5
kirillgarbar Sep 19, 2022
112271e
Correct CSR format for elementwise and formatting
kirillgarbar Sep 21, 2022
83f479a
Benchmarks build fix
kirillgarbar Sep 21, 2022
3282bd6
Vector type moved to backend. Added GPU versions
kirillgarbar Sep 22, 2022
2747b77
Old vector types removed
kirillgarbar Sep 22, 2022
3519203
Build fix
kirillgarbar Sep 25, 2022
239b1fe
CSR elementwise moved to CSRMatrix module
kirillgarbar Sep 25, 2022
d7f2435
New test names
kirillgarbar Sep 25, 2022
80747b4
Merge code refactored
kirillgarbar Sep 25, 2022
8df0d50
COO to CSR in elementwise instead of DCSR to CSR
kirillgarbar Sep 25, 2022
6cd18ba
elementwiseToCOO
kirillgarbar Oct 2, 2022
9156991
ClDenseVector inherits ClArray
kirillgarbar Oct 6, 2022
112a4ab
Correct size member for sparse vectors
kirillgarbar Oct 9, 2022
a6cf061
Catching InvalidBufferSize in tests
kirillgarbar Oct 15, 2022
22e6c3e
ClDenseVector struct instead of inheritance
kirillgarbar Oct 17, 2022
f12e605
ClArray and Array extensions instead of wrapper-types for vectors
kirillgarbar Oct 22, 2022
9de7da5
Dispose and FromArray correction in ArraysExnentions
kirillgarbar Oct 23, 2022
33d974e
Elementwise setPositions fix
kirillgarbar Oct 29, 2022
36b3be4
Deleting unused and duplicated methods
kirillgarbar Oct 30, 2022
b48705e
SparseVector instead of COO, tuples deleted
kirillgarbar Oct 30, 2022
7affcd0
ArraysExnensions methods name changed
kirillgarbar Oct 30, 2022
5814867
Build fix
kirillgarbar Oct 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions benchmarks/GraphBLAS-sharp.Benchmarks/BenchmarksEWiseAdd.fs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ module M =
type EWiseAddBenchmarks4Float32COOWithoutDataTransfer() =

inherit EWiseAddBenchmarksWithoutDataTransfer<Backend.COOMatrix<float32>,float32>(
(fun context wgSize -> Backend.COOMatrix.eWiseAdd context Backend.Common.StandardOperations.float32Sum wgSize),
(fun context wgSize -> Backend.COOMatrix.elementwise context Backend.Common.StandardOperations.float32Sum wgSize),
float32,
(fun _ -> Utils.nextSingle (System.Random())),
M.buildCooMatrix
Expand All @@ -286,7 +286,7 @@ type EWiseAddBenchmarks4Float32COOWithoutDataTransfer() =
type EWiseAddBenchmarks4Float32COOWithDataTransfer() =

inherit EWiseAddBenchmarksWithDataTransfer<Backend.COOMatrix<float32>,float32>(
(fun context wgSize -> Backend.COOMatrix.eWiseAdd context Backend.Common.StandardOperations.float32Sum wgSize),
(fun context wgSize -> Backend.COOMatrix.elementwise context Backend.Common.StandardOperations.float32Sum wgSize),
float32,
(fun _ -> Utils.nextSingle (System.Random())),
M.buildCooMatrix,
Expand All @@ -300,7 +300,7 @@ type EWiseAddBenchmarks4Float32COOWithDataTransfer() =
type EWiseAddBenchmarks4BoolCOOWithoutDataTransfer() =

inherit EWiseAddBenchmarksWithoutDataTransfer<Backend.COOMatrix<bool>,bool>(
(fun context wgSize -> Backend.COOMatrix.eWiseAdd context Backend.Common.StandardOperations.boolSum wgSize),
(fun context wgSize -> Backend.COOMatrix.elementwise context Backend.Common.StandardOperations.boolSum wgSize),
(fun _ -> true),
(fun _ -> true),
M.buildCooMatrix
Expand All @@ -313,7 +313,7 @@ type EWiseAddBenchmarks4BoolCOOWithoutDataTransfer() =
type EWiseAddBenchmarks4Float32CSRWithoutDataTransfer() =

inherit EWiseAddBenchmarksWithoutDataTransfer<Backend.CSRMatrix<float32>,float32>(
(fun context wgSize -> Backend.CSRMatrix.eWiseAdd context Backend.Common.StandardOperations.float32Sum wgSize),
(fun context wgSize -> Backend.CSRMatrix.elementwise context Backend.Common.StandardOperations.float32Sum wgSize),
float32,
(fun _ -> Utils.nextSingle (System.Random())),
M.buildCsrMatrix
Expand All @@ -326,7 +326,7 @@ type EWiseAddBenchmarks4Float32CSRWithoutDataTransfer() =
type EWiseAddBenchmarks4BoolCSRWithoutDataTransfer() =

inherit EWiseAddBenchmarksWithoutDataTransfer<Backend.CSRMatrix<bool>,bool>(
(fun context wgSize -> Backend.CSRMatrix.eWiseAdd context Backend.Common.StandardOperations.boolSum wgSize),
(fun context wgSize -> Backend.CSRMatrix.elementwise context Backend.Common.StandardOperations.boolSum wgSize),
(fun _ -> true),
(fun _ -> true),
M.buildCsrMatrix
Expand All @@ -340,7 +340,7 @@ type EWiseAddBenchmarks4BoolCSRWithoutDataTransfer() =
type EWiseAddAtLeastOneBenchmarks4BoolCOOWithoutDataTransfer() =

inherit EWiseAddBenchmarksWithoutDataTransfer<Backend.COOMatrix<bool>,bool>(
(fun context wgSize -> Backend.COOMatrix.eWiseAddAtLeastOne context Backend.Common.StandardOperations.boolSumAtLeastOne wgSize),
(fun context wgSize -> Backend.COOMatrix.elementwiseAtLeastOne context Backend.Common.StandardOperations.boolSumAtLeastOne wgSize),
(fun _ -> true),
(fun _ -> true),
M.buildCooMatrix
Expand All @@ -352,7 +352,7 @@ type EWiseAddAtLeastOneBenchmarks4BoolCOOWithoutDataTransfer() =
type EWiseAddAtLeastOneBenchmarks4BoolCSRWithoutDataTransfer() =

inherit EWiseAddBenchmarksWithoutDataTransfer<Backend.CSRMatrix<bool>,bool>(
(fun context wgSize -> Backend.CSRMatrix.eWiseAddAtLeastOne context Backend.Common.StandardOperations.boolSumAtLeastOne wgSize),
(fun context wgSize -> Backend.CSRMatrix.elementwiseAtLeastOne context Backend.Common.StandardOperations.boolSumAtLeastOne wgSize),
(fun _ -> true),
(fun _ -> true),
M.buildCsrMatrix
Expand All @@ -364,7 +364,7 @@ type EWiseAddAtLeastOneBenchmarks4BoolCSRWithoutDataTransfer() =
type EWiseAddAtLeastOneBenchmarks4Float32COOWithoutDataTransfer() =

inherit EWiseAddBenchmarksWithoutDataTransfer<Backend.COOMatrix<float32>,float32>(
(fun context wgSize -> Backend.COOMatrix.eWiseAddAtLeastOne context Backend.Common.StandardOperations.float32SumAtLeastOne wgSize),
(fun context wgSize -> Backend.COOMatrix.elementwiseAtLeastOne context Backend.Common.StandardOperations.float32SumAtLeastOne wgSize),
float32,
(fun _ -> Utils.nextSingle (System.Random())),
M.buildCooMatrix
Expand All @@ -376,7 +376,7 @@ type EWiseAddAtLeastOneBenchmarks4Float32COOWithoutDataTransfer() =
type EWiseAddAtLeastOneBenchmarks4Float32CSRWithoutDataTransfer() =

inherit EWiseAddBenchmarksWithoutDataTransfer<Backend.CSRMatrix<float32>,float32>(
(fun context wgSize -> Backend.CSRMatrix.eWiseAddAtLeastOne context Backend.Common.StandardOperations.float32SumAtLeastOne wgSize),
(fun context wgSize -> Backend.CSRMatrix.elementwiseAtLeastOne context Backend.Common.StandardOperations.float32SumAtLeastOne wgSize),
float32,
(fun _ -> Utils.nextSingle (System.Random())),
M.buildCsrMatrix
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/GraphBLAS-sharp.Benchmarks/BenchmarksMxv.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace GraphBLAS.FSharp.Benchmarks

open GraphBLAS.FSharp
open GraphBLAS.FSharp.Backend
open BenchmarkDotNet.Attributes
open BenchmarkDotNet.Configs
open BenchmarkDotNet.Columns
Expand Down Expand Up @@ -75,4 +76,4 @@ type MxvBenchmarks() =
| ".mtx" -> MtxReader(Utils.getFullPathToMatrix "Common" matrixFilename)
| _ -> failwith "Unsupported matrix format"
)
*)
*)
4 changes: 2 additions & 2 deletions benchmarks/GraphBLAS-sharp.Benchmarks/Helpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ module Utils =

let rowIndices2rowPointers (rowIndices: int []) rowCount =
let nnzPerRow = Array.zeroCreate rowCount
let rowPointers = Array.zeroCreate rowCount
let rowPointers = Array.zeroCreate (rowCount + 1)

Array.iter (fun rowIndex -> nnzPerRow.[rowIndex] <- nnzPerRow.[rowIndex] + 1) rowIndices

for i in 1 .. rowCount - 1 do
for i in 1 .. rowCount do
rowPointers.[i] <- rowPointers.[i - 1] + nnzPerRow.[i - 1]

rowPointers
2 changes: 1 addition & 1 deletion src/GraphBLAS-sharp.Backend/Common/StandardOperations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module StandardOperations =
| Both _ -> res <- true
| _ -> ()

if res then None else (Some true) @>
if res then Some true else None @>

let intMulAtLeastOne = mkNumericMulAtLeastOne 0
let byteMulAtLeastOne = mkNumericMulAtLeastOne 0uy
Expand Down
4 changes: 4 additions & 0 deletions src/GraphBLAS-sharp.Backend/Common/Utils.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
namespace GraphBLAS.FSharp.Backend.Common

open Brahma.FSharp

module internal Utils =
let defaultWorkGroupSize = 32

let floorToPower2 =
fun x -> x ||| (x >>> 1)
>> fun x -> x ||| (x >>> 2)
Expand Down
9 changes: 7 additions & 2 deletions src/GraphBLAS-sharp.Backend/GraphBLAS-sharp.Backend.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
Expand All @@ -18,12 +18,17 @@
<Compile Include="Common/BitonicSort.fs" />
<Compile Include="Common/StandardOperations.fs" />
<Compile Include="Predefined/PrefixSum.fs" />
<Compile Include="Matrices.fs" />
<Compile Include="Objects/Common.fs" />
<Compile Include="Objects/ArraysExtentions.fs" />
<Compile Include="Objects/Vector.fs" />
<Compile Include="Objects/Matrix.fs" />
<Compile Include="Matrix/COOMatrix/COOMatrix.fs" />
<Compile Include="Matrix/CSRMatrix/Elementwise.fs" />
<Compile Include="Matrix/CSRMatrix/CSRMatrix.fs" />
<Compile Include="Matrix/CSRMatrix/SpGEMM.fs" />
<Compile Include="Matrix/CSRMatrix/SpMV.fs" />
<Compile Include="Matrix/Matrix.fs" />
<Folder Include="Vector" />
<!--Compile Include="Backend/CSRMatrix/GetTuples.fs" /-->
<!--Compile Include="Backend/CSRMatrix/SpMSpV.fs" /-->
<!--Compile Include="Backend/CSRMatrix/Transpose.fs" /-->
Expand Down
18 changes: 9 additions & 9 deletions src/GraphBLAS-sharp.Backend/Matrix/COOMatrix/COOMatrix.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ module COOMatrix =
let private setPositions<'a when 'a: struct> (clContext: ClContext) workGroupSize =

let setPositions =
<@ fun (ndRange: Range1D) prefixSumArrayLength (allRowsBuffer: ClArray<int>) (allColumnsBuffer: ClArray<int>) (allValuesBuffer: ClArray<'a>) (prefixSumArrayBuffer: ClArray<int>) (resultRowsBuffer: ClArray<int>) (resultColumnsBuffer: ClArray<int>) (resultValuesBuffer: ClArray<'a>) ->
<@ fun (ndRange: Range1D) prefixSumArrayLength resultLength (allRowsBuffer: ClArray<int>) (allColumnsBuffer: ClArray<int>) (allValuesBuffer: ClArray<'a>) (prefixSumArrayBuffer: ClArray<int>) (resultRowsBuffer: ClArray<int>) (resultColumnsBuffer: ClArray<int>) (resultValuesBuffer: ClArray<'a>) ->

let i = ndRange.GlobalID0
let index = prefixSumArrayBuffer.[i]

if i = prefixSumArrayLength - 1
|| i < prefixSumArrayLength
&& prefixSumArrayBuffer.[i]
<> prefixSumArrayBuffer.[i + 1] then
let index = prefixSumArrayBuffer.[i]

if (i < prefixSumArrayLength - 1
&& index <> prefixSumArrayBuffer.[i + 1])
|| (i = prefixSumArrayLength - 1
&& index < resultLength) then
resultRowsBuffer.[index] <- allRowsBuffer.[i]
resultColumnsBuffer.[index] <- allColumnsBuffer.[i]
resultValuesBuffer.[index] <- allValuesBuffer.[i] @>
Expand Down Expand Up @@ -82,6 +81,7 @@ module COOMatrix =
kernel.KernelFunc
ndRange
prefixSumArrayLength
resultLength
allRows
allColumns
allValues
Expand Down Expand Up @@ -385,7 +385,7 @@ module COOMatrix =
///<param name="clContext">.</param>
///<param name="opAdd">.</param>
///<param name="workGroupSize">Should be a power of 2 and greater than 1.</param>
let eWiseAdd<'a, 'b, 'c when 'a: struct and 'b: struct and 'c: struct and 'c: equality>
let elementwise<'a, 'b, 'c when 'a: struct and 'b: struct and 'c: struct and 'c: equality>
(clContext: ClContext)
(opAdd: Expr<'a option -> 'b option -> 'c option>)
workGroupSize
Expand Down Expand Up @@ -613,7 +613,7 @@ module COOMatrix =
///<param name="clContext">.</param>
///<param name="opAdd">.</param>
///<param name="workGroupSize">Should be a power of 2 and greater than 1.</param>
let eWiseAddAtLeastOne<'a, 'b, 'c when 'a: struct and 'b: struct and 'c: struct and 'c: equality>
let elementwiseAtLeastOne<'a, 'b, 'c when 'a: struct and 'b: struct and 'c: struct and 'c: equality>
(clContext: ClContext)
(opAdd: Expr<AtLeastOne<'a, 'b> -> 'c option>)
workGroupSize
Expand Down
151 changes: 147 additions & 4 deletions src/GraphBLAS-sharp.Backend/Matrix/CSRMatrix/CSRMatrix.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace GraphBLAS.FSharp.Backend
open Brahma.FSharp
open GraphBLAS.FSharp.Backend
open GraphBLAS.FSharp.Backend.Common
open GraphBLAS.FSharp.Backend.Elementwise
open Microsoft.FSharp.Quotations

module CSRMatrix =
Expand Down Expand Up @@ -79,12 +80,13 @@ module CSRMatrix =
Columns = matrix.Columns
Values = matrix.Values }

let eWiseAdd (clContext: ClContext) (opAdd: Expr<'a option -> 'b option -> 'c option>) workGroupSize =
///<remarks>Old version</remarks>
let elementwiseWithCOO (clContext: ClContext) (opAdd: Expr<'a option -> 'b option -> 'c option>) workGroupSize =

let prepareRows = prepareRows clContext workGroupSize

let eWiseCOO =
COOMatrix.eWiseAdd clContext opAdd workGroupSize
COOMatrix.elementwise clContext opAdd workGroupSize

let toCSRInplace =
COOMatrix.toCSRInplace clContext workGroupSize
Expand Down Expand Up @@ -113,12 +115,17 @@ module CSRMatrix =

toCSRInplace processor m3COO

let eWiseAddAtLeastOne (clContext: ClContext) (opAdd: Expr<AtLeastOne<'a, 'b> -> 'c option>) workGroupSize =
///<remarks>Old version</remarks>
let elementwiseAtLeastOneWithCOO
(clContext: ClContext)
(opAdd: Expr<AtLeastOne<'a, 'b> -> 'c option>)
workGroupSize
=

let prepareRows = prepareRows clContext workGroupSize

let eWiseCOO =
COOMatrix.eWiseAddAtLeastOne clContext opAdd workGroupSize
COOMatrix.elementwiseAtLeastOne clContext opAdd workGroupSize

let toCSRInplace =
COOMatrix.toCSRInplace clContext workGroupSize
Expand Down Expand Up @@ -177,3 +184,139 @@ module CSRMatrix =
let coo = toCOO queue matrix
let transposedCoo = transposeInplace queue coo
toCSRInplace queue transposedCoo

let elementwiseToCOO<'a, 'b, 'c when 'a: struct and 'b: struct and 'c: struct and 'c: equality>
(clContext: ClContext)
(opAdd: Expr<'a option -> 'b option -> 'c option>)
workGroupSize
=

let merge = merge clContext workGroupSize

let preparePositions =
preparePositions clContext opAdd Utils.defaultWorkGroupSize

let setPositions =
setPositions<'c> clContext Utils.defaultWorkGroupSize

fun (queue: MailboxProcessor<_>) (matrixLeft: CSRMatrix<'a>) (matrixRight: CSRMatrix<'b>) ->

let allRows, allColumns, leftMergedValues, rightMergedValues, isRowEnd, isLeft =
merge
queue
matrixLeft.RowPointers
matrixLeft.Columns
matrixLeft.Values
matrixRight.RowPointers
matrixRight.Columns
matrixRight.Values

let positions, allValues =
preparePositions queue allColumns leftMergedValues rightMergedValues isRowEnd isLeft

queue.Post(Msg.CreateFreeMsg<_>(leftMergedValues))
queue.Post(Msg.CreateFreeMsg<_>(rightMergedValues))

let resultRows, resultColumns, resultValues, positions, positionsSum =
setPositions queue allRows allColumns allValues positions

queue.Post(Msg.CreateFreeMsg<_>(allRows))
queue.Post(Msg.CreateFreeMsg<_>(isLeft))
queue.Post(Msg.CreateFreeMsg<_>(isRowEnd))
queue.Post(Msg.CreateFreeMsg<_>(positions))
queue.Post(Msg.CreateFreeMsg<_>(allColumns))
queue.Post(Msg.CreateFreeMsg<_>(allValues))

{ Context = clContext
RowCount = matrixLeft.RowCount
ColumnCount = matrixLeft.ColumnCount
Rows = resultRows
Columns = resultColumns
Values = resultValues }

let elementwise<'a, 'b, 'c when 'a: struct and 'b: struct and 'c: struct and 'c: equality>
(clContext: ClContext)
(opAdd: Expr<'a option -> 'b option -> 'c option>)
workGroupSize
=

let elementwiseToCOO =
elementwiseToCOO clContext opAdd workGroupSize

let toCSRInplace =
COOMatrix.toCSRInplace clContext Utils.defaultWorkGroupSize

fun (queue: MailboxProcessor<_>) (matrixLeft: CSRMatrix<'a>) (matrixRight: CSRMatrix<'b>) ->

let cooRes =
elementwiseToCOO queue matrixLeft matrixRight

toCSRInplace queue cooRes

let elementwiseAtLeastOneToCOO<'a, 'b, 'c when 'a: struct and 'b: struct and 'c: struct and 'c: equality>
(clContext: ClContext)
(opAdd: Expr<AtLeastOne<'a, 'b> -> 'c option>)
workGroupSize
=

let merge = merge clContext workGroupSize

let preparePositions =
preparePositionsAtLeastOne clContext opAdd Utils.defaultWorkGroupSize

let setPositions =
setPositions<'c> clContext Utils.defaultWorkGroupSize

fun (queue: MailboxProcessor<_>) (matrixLeft: CSRMatrix<'a>) (matrixRight: CSRMatrix<'b>) ->

let allRows, allColumns, leftMergedValues, rightMergedValues, isRowEnd, isLeft =
merge
queue
matrixLeft.RowPointers
matrixLeft.Columns
matrixLeft.Values
matrixRight.RowPointers
matrixRight.Columns
matrixRight.Values

let positions, allValues =
preparePositions queue allColumns leftMergedValues rightMergedValues isRowEnd isLeft

queue.Post(Msg.CreateFreeMsg<_>(leftMergedValues))
queue.Post(Msg.CreateFreeMsg<_>(rightMergedValues))

let resultRows, resultColumns, resultValues, positions, positionsSum =
setPositions queue allRows allColumns allValues positions

queue.Post(Msg.CreateFreeMsg<_>(allRows))
queue.Post(Msg.CreateFreeMsg<_>(isLeft))
queue.Post(Msg.CreateFreeMsg<_>(isRowEnd))
queue.Post(Msg.CreateFreeMsg<_>(positions))
queue.Post(Msg.CreateFreeMsg<_>(allColumns))
queue.Post(Msg.CreateFreeMsg<_>(allValues))

{ Context = clContext
RowCount = matrixLeft.RowCount
ColumnCount = matrixLeft.ColumnCount
Rows = resultRows
Columns = resultColumns
Values = resultValues }

let elementwiseAtLeastOne<'a, 'b, 'c when 'a: struct and 'b: struct and 'c: struct and 'c: equality>
(clContext: ClContext)
(opAdd: Expr<AtLeastOne<'a, 'b> -> 'c option>)
workGroupSize
=

let elementwiseAtLeastOneToCOO =
elementwiseAtLeastOneToCOO clContext opAdd workGroupSize

let toCSRInplace =
COOMatrix.toCSRInplace clContext Utils.defaultWorkGroupSize

fun (queue: MailboxProcessor<_>) (matrixLeft: CSRMatrix<'a>) (matrixRight: CSRMatrix<'b>) ->

let cooRes =
elementwiseAtLeastOneToCOO queue matrixLeft matrixRight

toCSRInplace queue cooRes
Loading