Skip to content

Commit 9b6fd09

Browse files
committed
Radix version returning values only
1 parent 91513e1 commit 9b6fd09

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

src/GraphBLAS-sharp.Backend/Common/Sort/Radix.fs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,5 +326,17 @@ module Radix =
326326

327327
(fst keysPair, fst valuesPair)
328328

329+
let runByKeysStandardValuesOnly clContext workGroupSize =
330+
let runByKeys =
331+
runByKeys clContext workGroupSize defaultBitCount
332+
333+
fun (processor: MailboxProcessor<_>) allocationMode (keys: ClArray<int>) (values: ClArray<'a>) ->
334+
let keys, values =
335+
runByKeys processor allocationMode keys values
336+
337+
keys.Free processor
338+
339+
values
340+
329341
let runByKeysStandard clContext workGroupSize =
330342
runByKeys clContext workGroupSize defaultBitCount

src/GraphBLAS-sharp.Backend/Matrix/SpGeMM/Expand.fs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,40 +171,32 @@ module Expand =
171171
let sortByColumnsAndRows (clContext: ClContext) workGroupSize =
172172

173173
let sortByKeyIndices =
174-
Radix.runByKeysStandard clContext workGroupSize
174+
Radix.runByKeysStandardValuesOnly clContext workGroupSize
175175

176176
let sortByKeyValues =
177-
Radix.runByKeysStandard clContext workGroupSize
177+
Radix.runByKeysStandardValuesOnly clContext workGroupSize
178178

179179
let sortKeys =
180180
Radix.standardRunKeysOnly clContext workGroupSize
181181

182182
fun (processor: MailboxProcessor<_>) (values: ClArray<'a>) (columns: ClArray<int>) (rows: ClArray<int>) ->
183183
// sort by columns
184-
let keys, valuesSortedByColumns =
184+
let valuesSortedByColumns =
185185
sortByKeyValues processor DeviceOnly columns values
186186

187-
keys.Free processor
188-
189-
let keys, rowsSortedByColumns =
187+
let rowsSortedByColumns =
190188
sortByKeyIndices processor DeviceOnly columns rows
191189

192-
keys.Free processor
193-
194190
//TODO: already sorted above?
195191
let sortedColumns = sortKeys processor columns
196192

197193
// sort by rows
198-
let keys, valuesSortedByRows =
194+
let valuesSortedByRows =
199195
sortByKeyValues processor DeviceOnly rowsSortedByColumns valuesSortedByColumns
200196

201-
keys.Free processor
202-
203-
let keys, columnsSortedByRows =
197+
let columnsSortedByRows =
204198
sortByKeyIndices processor DeviceOnly rowsSortedByColumns sortedColumns
205199

206-
keys.Free processor
207-
208200
//TODO: already sorted above?
209201
let sortedRows = sortKeys processor rowsSortedByColumns
210202

0 commit comments

Comments
 (0)