Skip to content

Commit ab870bd

Browse files
committed
refactor
1 parent 3bb2e9a commit ab870bd

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

src/GraphBLAS-sharp.Backend/Quotes/SubSum.fs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -56,55 +56,6 @@ module SubSum =
5656

5757
step <- step >>> 1 @>
5858

59-
let upSweepByKey opAdd =
60-
<@ fun wgSize lid (localBuffer: 'a []) (localKeys: 'b []) ->
61-
let mutable step = 2
62-
63-
while step <= wgSize do
64-
let i = step * (lid + 1) - 1
65-
66-
let firstIndex = i - (step >>> 1) // TODO(work ?)
67-
let secondIndex = i
68-
69-
let firstKey = localKeys.[firstIndex]
70-
let secondKey = localKeys.[secondIndex]
71-
72-
if lid < wgSize / step && firstKey = secondKey then
73-
74-
let firstValue = localBuffer.[firstIndex]
75-
let secondValue = localBuffer.[secondIndex]
76-
77-
localBuffer.[secondIndex] <- (%opAdd) firstValue secondValue
78-
79-
step <- step <<< 1
80-
81-
barrierLocal () @>
82-
83-
let downSweepByKey opAdd =
84-
<@ fun wgSize lid (localBuffer: 'a []) (localKeys: int []) ->
85-
let mutable step = wgSize
86-
87-
while step > 1 do
88-
barrierLocal ()
89-
90-
let rightIndex = step * (lid + 1) - 1
91-
let leftIndex = rightIndex - (step >>> 1)
92-
93-
let rightKey = localKeys.[rightIndex]
94-
let leftKey = localKeys.[leftIndex]
95-
96-
if lid < wgSize / step && rightKey = leftKey then
97-
98-
let tmp = localBuffer.[rightIndex]
99-
100-
let rightOperand = localBuffer.[leftIndex] // Brahma error
101-
let buff = (%opAdd) tmp rightOperand
102-
103-
localBuffer.[rightIndex] <- buff
104-
localBuffer.[leftIndex] <- tmp
105-
106-
step <- step >>> 1 @>
107-
10859
let localPrefixSum opAdd =
10960
<@ fun (lid: int) (workGroupSize: int) (array: 'a []) ->
11061
let mutable offset = 1

0 commit comments

Comments
 (0)