Skip to content

Commit 2d86b35

Browse files
committed
fix: blit, choose2 tests exception
1 parent 6c0a71f commit 2d86b35

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

paket.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ NUGET
968968
System.Security.Principal.Windows (>= 5.0) - restriction: || (&& (>= monoandroid) (< netstandard1.3)) (&& (< monoandroid) (>= netcoreapp2.0)) (>= monotouch) (&& (< net46) (< netcoreapp2.0) (>= netstandard2.0)) (>= net461) (>= netcoreapp2.1) (>= uap10.1) (>= xamarinios) (>= xamarinmac) (>= xamarintvos) (>= xamarinwatchos)
969969
Microsoft.Win32.SystemEvents (7.0) - restriction: >= net6.0
970970
Mono.Posix.NETStandard (1.0) - restriction: >= netstandard2.0
971-
MSBuild.StructuredLogger (2.1.820) - restriction: >= netstandard2.0
971+
MSBuild.StructuredLogger (2.1.844) - restriction: >= netstandard2.0
972972
Microsoft.Build.Framework (>= 17.5) - restriction: >= netstandard2.0
973973
Microsoft.Build.Utilities.Core (>= 17.5) - restriction: >= netstandard2.0
974974
Newtonsoft.Json (13.0.3) - restriction: >= netstandard2.0
@@ -1221,7 +1221,7 @@ NUGET
12211221
System.Security.Principal.Windows (>= 5.0) - restriction: || (&& (>= monoandroid) (< netstandard1.3)) (&& (< monoandroid) (>= netcoreapp2.0)) (>= monotouch) (&& (< net46) (< netcoreapp2.0) (>= netstandard2.0)) (>= net461) (>= netcoreapp2.1) (>= uap10.1) (>= xamarinios) (>= xamarinmac) (>= xamarintvos) (>= xamarinwatchos)
12221222
Microsoft.Win32.SystemEvents (7.0) - restriction: >= net6.0
12231223
Mono.Posix.NETStandard (1.0) - restriction: >= netstandard2.0
1224-
MSBuild.StructuredLogger (2.1.820) - restriction: >= netstandard2.0
1224+
MSBuild.StructuredLogger (2.1.844) - restriction: >= netstandard2.0
12251225
Microsoft.Build.Framework (>= 17.5) - restriction: >= netstandard2.0
12261226
Microsoft.Build.Utilities.Core (>= 17.5) - restriction: >= netstandard2.0
12271227
Newtonsoft.Json (13.0.3) - restriction: >= netstandard2.0

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,19 @@ let makeTest2 testContext isEqual opMap testFun (firstArray: 'a [], secondArray:
6565
Array.map2 opMap firstArray secondArray
6666
|> Array.choose id
6767

68-
let clFirstArray = context.CreateClArray firstArray
69-
let clSecondArray = context.CreateClArray secondArray
68+
if expected.Length > 0 then
69+
let clFirstArray = context.CreateClArray firstArray
70+
let clSecondArray = context.CreateClArray secondArray
7071

71-
let (clActual: ClArray<_>) =
72-
testFun processor HostInterop clFirstArray clSecondArray
72+
let (clActual: ClArray<_>) =
73+
testFun processor HostInterop clFirstArray clSecondArray
7374

74-
let actual = clActual.ToHostAndFree processor
75-
clFirstArray.Free processor
76-
clSecondArray.Free processor
75+
let actual = clActual.ToHostAndFree processor
76+
clFirstArray.Free processor
77+
clSecondArray.Free processor
7778

78-
"Results must be the same"
79-
|> Utils.compareArrays isEqual actual expected
79+
"Results must be the same"
80+
|> Utils.compareArrays isEqual actual expected
8081

8182
let createTest2 testsContext (isEqual: 'a -> 'a -> bool) (opMapQ, opMap) testFun =
8283
testFun opMapQ testsContext.ClContext Utils.defaultWorkGroupSize

tests/GraphBLAS-sharp.Tests/Backend/Matrix/SubRows.fs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ let makeTest isEqual zero testFun (array: 'a [,], sourceRow, count) =
2525

2626
if matrix.NNZ > 0 then
2727

28-
let clMatrix = matrix.ToDevice context
29-
30-
let clActual: ClMatrix.COO<'a> =
31-
testFun processor HostInterop sourceRow count clMatrix
32-
33-
let actual = clActual.ToHostAndFree processor
34-
3528
let expected =
3629
array
3730
|> Array2D.mapi (fun rowIndex columnIndex value -> (value, rowIndex, columnIndex))
@@ -47,7 +40,15 @@ let makeTest isEqual zero testFun (array: 'a [,], sourceRow, count) =
4740
Columns = columns
4841
Values = values }
4942

50-
Utils.compareCOOMatrix isEqual actual expected
43+
if expected.NNZ > 0 then
44+
let clMatrix = matrix.ToDevice context
45+
46+
let clActual: ClMatrix.COO<'a> =
47+
testFun processor HostInterop sourceRow count clMatrix
48+
49+
let actual = clActual.ToHostAndFree processor
50+
51+
Utils.compareCOOMatrix isEqual actual expected
5152

5253
let createTest isEqual (zero: 'a) =
5354
CSR.Matrix.subRows context Utils.defaultWorkGroupSize

0 commit comments

Comments
 (0)