File tree Expand file tree Collapse file tree
tests/GraphBLAS-sharp.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ module BFS =
1616 while not break' do
1717 currentLevel <- currentLevel + 1
1818
19- // NOTE mask application is ugly
2019 let! frontierMask = Vector.mask frontier
2120 do ! Vector.fillSubVector levels frontierMask ( Scalar currentLevel) // v[q] = d
2221
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ module internal rec Transpose =
1818
1919 return {
2020 RowCount = matrix.ColumnCount
21- ColumnCount = matrix.ColumnCount
21+ ColumnCount = matrix.RowCount
2222 RowPointers = compressedRows
2323 ColumnIndices = cols
2424 Values = coo.Values
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ let logger = Log.create "BitonicSort.Tests"
1818let testCases = [
1919 let config = Utils.defaultConfig
2020
21- ftestPropertyWithConfig config " Simple correctness test on uint64 * int" <| fun ( array : ( uint64 * int )[]) ->
21+ ptestPropertyWithConfig config " Simple correctness test on uint64 * int" <| fun ( array : ( uint64 * int )[]) ->
2222 let expected = Array.sortBy ( fun ( key , _ ) -> key) array
2323
2424 let actual =
Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ let testCases = [
1616 let actual =
1717 opencl {
1818 let! ( result , _ ) = PrefixSum.runInclude array
19- let! _ = ToHost result
19+ if array.Length <> 0 then
20+ let! _ = ToHost result
21+ ()
2022 return result
2123 }
2224 |> OpenCLEvaluationContext() .RunSync
@@ -37,7 +39,10 @@ let testCases = [
3739 let actual =
3840 opencl {
3941 let! ( result , _ ) = PrefixSum.runInclude array
40- let! _ = ToHost result
42+ if array.Length <> 0 then
43+ let! _ = ToHost result
44+ ()
45+
4146 return result
4247 }
4348 |> OpenCLEvaluationContext() .RunSync
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ let testCases = [
1717 opencl {
1818 let! copiedArray = Copy.copyArray array
1919 let! result = RemoveDuplicates.fromArray copiedArray
20- let! _ = ToHost result
20+ if array.Length <> 0 then
21+ let! _ = ToHost result
22+ ()
2123 return result
2224 }
2325 |> OpenCLEvaluationContext() .RunSync
@@ -39,7 +41,9 @@ let testCases = [
3941 opencl {
4042 let! copiedArray = Copy.copyArray array
4143 let! result = RemoveDuplicates.fromArray copiedArray
42- let! _ = ToHost result
44+ if array.Length <> 0 then
45+ let! _ = ToHost result
46+ ()
4347 return result
4448 }
4549 |> OpenCLEvaluationContext() .RunSync
Original file line number Diff line number Diff line change @@ -276,6 +276,15 @@ module Generators =
276276 |> genericSparseGenerator false Arb.generate< bool>
277277 |> Arb.fromGen
278278
279+ type ArrayOfDistinctKeys () =
280+ // Stack overflow.
281+ static member ArrayOfDistinctKeysArb () =
282+ gen {
283+ let! array = Arb.generate<( uint64 * int)[]>
284+ return Array.distinctBy ( fun ( key , _ ) -> key) array
285+ }
286+ |> Arb.fromGen
287+
279288module Utils =
280289 let defaultConfig =
281290 { FsCheckConfig.defaultConfig with
@@ -288,6 +297,7 @@ module Utils =
288297 typeof< Generators.PairOfMatricesOfCompatibleSize>
289298 typeof< Generators.PairOfSparseMatrixOAndVectorfCompatibleSize>
290299 typeof< Generators.PairOfSparseVectorAndMatrixOfCompatibleSize>
300+ // typeof<Generators.ArrayOfDistinctKeys>
291301 ]
292302 }
293303
You can’t perform that action at this time.
0 commit comments