Skip to content

Commit 5195a86

Browse files
committed
RawCommandQueue 2
1 parent 4485640 commit 5195a86

33 files changed

+89
-85
lines changed

tests/GraphBLAS-sharp.Tests/Backend/Algorithms/BFS.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ let testFixtures (testContext: TestContext) =
7878

7979
matrix.Dispose queue
8080
matrixBool.Dispose queue
81-
res.Dispose queue
82-
resSparse.Dispose queue
83-
resPushPull.Dispose queue
81+
res.Dispose()
82+
resSparse.Dispose()
83+
resPushPull.Dispose()
8484

8585
match resHost, resHostSparse, resHostPushPull with
8686
| Vector.Dense resHost, Vector.Dense resHostSparse, Vector.Dense resHostPushPull ->

tests/GraphBLAS-sharp.Tests/Backend/Algorithms/PageRank.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ let testFixtures (testContext: TestContext) =
104104

105105
preparedMatrix.Dispose queue
106106
matrix.Dispose queue
107-
res.Dispose queue
107+
res.Dispose()
108108

109109
match resHost with
110110
| Vector.Dense resHost ->

tests/GraphBLAS-sharp.Tests/Backend/Algorithms/SSSP.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ let testFixtures (testContext: TestContext) =
5252
let resHost = resDense.ToHost queue
5353

5454
matrix.Dispose queue
55-
resDense.Dispose queue
55+
resDense.Dispose()
5656

5757
match resHost with
5858
| Vector.Dense resHost ->

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ let makeTest<'a> isEqual testFun (source: 'a [], sourceIndex, target: 'a [], tar
2424

2525
testFun processor clSource sourceIndex clTarget targetIndex count
2626

27-
clSource.Free processor
27+
clSource.Free()
2828
let actual = clTarget.ToHostAndFree processor
2929

3030
// write to target --- target expected

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ let makeTest2 testContext isEqual opMap testFun (firstArray: 'a [], secondArray:
7373
testFun processor HostInterop clFirstArray clSecondArray
7474

7575
let actual = clActual.ToHostAndFree processor
76-
clFirstArray.Free processor
77-
clSecondArray.Free processor
76+
clFirstArray.Free()
77+
clSecondArray.Free()
7878

7979
"Results must be the same"
8080
|> Utils.compareArrays isEqual actual expected

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let makeTestGetChunk<'a when 'a: equality> testFun (array: 'a [], startPosition,
2525
let (clActual: ClArray<'a>) =
2626
testFun processor HostInterop clArray startPosition count
2727

28-
clArray.Free processor
28+
clArray.Free()
2929
let actual = clActual.ToHostAndFree processor
3030

3131
"Results must be the same"
@@ -56,7 +56,7 @@ let makeTestChunkBySize<'a when 'a: equality> isEqual testFun (array: 'a [], chu
5656
let clActual: ClArray<'a> [] =
5757
(testFun processor HostInterop chunkSize clArray)
5858

59-
clArray.Free processor
59+
clArray.Free()
6060

6161
let actual =
6262
clActual

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ let makeTest<'a> isEqual testFun (arrays: 'a [] []) =
2626
// release
2727
let actual = clActual.ToHostAndFree processor
2828

29-
clArrays
30-
|> Seq.iter (fun array -> array.Free processor)
29+
clArrays |> Seq.iter (fun array -> array.Free())
3130

3231
let expected = Seq.concat arrays |> Seq.toArray
3332

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ let q = Context.defaultContext.Queue
1919

2020
let config = Utils.defaultConfig
2121

22-
let makeTest<'a when 'a: equality> copyFun (array: array<'a>) =
22+
let makeTest<'a when 'a: equality>
23+
(copyFun: RawCommandQueue -> AllocationFlag -> ClArray<'a> -> int -> ClArray<'a>)
24+
(array: array<'a>)
25+
=
2326
if array.Length > 0 then
24-
let clArray = context.CreateClArray array
27+
let clArray: ClArray<'a> = context.CreateClArray array
2528

2629
let actual =
27-
(copyFun q HostInterop clArray: ClArray<_>)
30+
(copyFun q DeviceOnly clArray clArray.Length)
2831
.ToHostAndFree q
2932

30-
clArray.Free q
33+
clArray.Free()
3134

3235
logger.debug (
3336
eventX "Actual is {actual}"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ let makeTest<'a> isEqual (zero: 'a) testFun ((array, bitmap): 'a array * int arr
2929
actual
3030
|> Option.map (fun a -> a.ToHostAndFree processor)
3131

32-
arrayCl.Free processor
33-
bitmapCl.Free processor
32+
arrayCl.Free()
33+
bitmapCl.Free()
3434

3535
let expected =
3636
(bitmap, array)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ let makeTest<'a when 'a: equality> testFun (array: 'a [], position) =
2424

2525
let result: ClCell<'a> = testFun processor position clArray
2626

27-
clArray.Free processor
27+
clArray.Free()
2828
let actual = result.ToHost processor
2929

3030
let expected = Array.item position array

0 commit comments

Comments
 (0)