File tree Expand file tree Collapse file tree
src/GraphBLAS-sharp.Backend/Quotes
tests/GraphBLAS-sharp.Tests/Matrix Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ open GraphBLAS.FSharp.Backend.Objects
55module ArithmeticOperations =
66 let inline mkOpWithConst zero op constant =
77 <@ fun x ->
8- let mutable res = zero
8+ let mutable res = zero
99
10- match x with
11- | Some v -> res <- ( op v constant)
12- | None -> res <- constant
10+ match x with
11+ | Some v -> res <- ( op v constant)
12+ | None -> res <- constant
1313
14- if res = zero then None else Some res @>
14+ if res = zero then None else Some res @>
1515
1616 let inline mkNumericSum zero =
1717 <@ fun ( x : 't option ) ( y : 't option ) ->
Original file line number Diff line number Diff line change @@ -52,4 +52,3 @@ module BinSearch =
5252 leftEdge <- middleIdx + 1
5353
5454 result @>
55-
Original file line number Diff line number Diff line change @@ -116,9 +116,14 @@ let testFixturesMapAdd case =
116116 let q = case.TestContext.Queue
117117 q.Error.Add( fun e -> failwithf " %A " e)
118118
119- let addFloat64Q = ArithmeticOperations.mkOpWithConst 0.0 (+) 10.0
120- let addFloat32Q = ArithmeticOperations.mkOpWithConst 0.0 f (+) 10.0 f
121- let addByte = ArithmeticOperations.mkOpWithConst 0 uy (+) 10 uy
119+ let addFloat64Q =
120+ ArithmeticOperations.mkOpWithConst 0.0 (+) 10.0
121+
122+ let addFloat32Q =
123+ ArithmeticOperations.mkOpWithConst 0.0 f (+) 10.0 f
124+
125+ let addByte =
126+ ArithmeticOperations.mkOpWithConst 0 uy (+) 10 uy
122127
123128 if Utils.isFloat64Available context.ClDevice then
124129 createTestMap case 0.0 ((+) 10.0 ) Utils.floatIsEqual addFloat64Q Matrix.map
@@ -134,9 +139,14 @@ let testFixturesMapMul case =
134139 let q = case.TestContext.Queue
135140 q.Error.Add( fun e -> failwithf " %A " e)
136141
137- let mulFloat64Q = ArithmeticOperations.mkOpWithConst 0.0 (*) 10.0
138- let mulFloat32Q = ArithmeticOperations.mkOpWithConst 0.0 f (*) 10.0 f
139- let mulByte = ArithmeticOperations.mkOpWithConst 0 uy (*) 10 uy
142+ let mulFloat64Q =
143+ ArithmeticOperations.mkOpWithConst 0.0 (*) 10.0
144+
145+ let mulFloat32Q =
146+ ArithmeticOperations.mkOpWithConst 0.0 f (*) 10.0 f
147+
148+ let mulByte =
149+ ArithmeticOperations.mkOpWithConst 0 uy (*) 10 uy
140150
141151 if Utils.isFloat64Available context.ClDevice then
142152 createTestMap case 0.0 ((*) 10.0 ) Utils.floatIsEqual mulFloat64Q Matrix.map
You can’t perform that action at this time.
0 commit comments