@@ -6,11 +6,52 @@ open GraphBLAS.FSharp.Backend.Common
66
77module Common =
88 module Bitonic =
9+ /// <summary >
10+ /// Sorts in-place input array of values by their 2d indices,
11+ /// which are stored in two given arrays of keys: rows and columns.
12+ /// When comparing, it first looks at rows, then columns.
13+ /// </summary >
14+ /// <example >
15+ /// <code >
16+ /// let rows = [ | 0; 0; 3; 2; 1; 0; 5 |]
17+ /// let columns = [ | 0; 2; 1; 2; 0; 3; 5; |]
18+ /// let values = [ | 1.9; 2.8; 3.7; 4.6; 5.5; 6.4; 7.3; |]
19+ /// sortKeyValuesInplace clContext 32 processor rows columns values
20+ /// ...
21+ /// > val rows = [ | 0; 0; 0; 1; 2; 3; 5 |]
22+ /// > let columns = [ | 0; 2; 3; 0; 2; 1; 5; |]
23+ /// > val values = [ | 1.9; 2.8; 6.4; 5.5; 4.6; 3.7; 7.3 |]
24+ /// </code>
25+ /// </example>
926 let sortKeyValuesInplace = Sort.Bitonic.sortKeyValuesInplace
1027
1128 module Radix =
29+ /// <summary >
30+ /// Sorts stable input array of values by given integer keys.
31+ /// </summary >
32+ /// <example >
33+ /// <code >
34+ /// let keys = [ | 0; 4; 3; 1; 2; 6; 5 |]
35+ /// let values = [ | 1.9; 2.8; 3.7; 4.6; 5.5; 6.4; 7.3; |]
36+ /// runByKeysStandard clContext 32 processor keys values
37+ /// ...
38+ /// > val keys = [ | 0; 1; 2; 3; 4; 5; 6 |]
39+ /// > val values = [ | 1.9; 4.6; 5.5; 3.7; 2.8; 7.3; 6.4 |]
40+ /// </code>
41+ /// </example>
1242 let runByKeysStandard = Sort.Radix.runByKeysStandard
1343
44+ /// <summary >
45+ /// Sorts stable input array of integer keys.
46+ /// </summary >
47+ /// <example >
48+ /// <code >
49+ /// let keys = [ | 0; 4; 3; 1; 2; 6; 5 |]
50+ /// standardRunKeysOnly clContext 32 processor keys
51+ /// ...
52+ /// > val keys = [ | 0; 1; 2; 3; 4; 5; 6 |]
53+ /// </code>
54+ /// </example>
1455 let standardRunKeysOnly = Sort.Radix.standardRunKeysOnly
1556
1657 module Gather =
@@ -53,7 +94,8 @@ module Common =
5394
5495 module Scatter =
5596 /// <summary >
56- /// Creates a new array from the given one where it is indicated by the array of positions at which position in the new array
97+ /// Creates a new array from the given one where it is indicated
98+ /// by the array of positions at which position in the new array
5799 /// should be a value from the given one.
58100 /// </summary >
59101 /// <remarks >
@@ -135,18 +177,68 @@ module Common =
135177 let initLastOccurrence valueMap = Scatter.initLastOccurrence valueMap
136178
137179 module PrefixSum =
180+ /// <summary >
181+ /// Exclude in-place prefix sum.
182+ /// </summary >
183+ /// <example >
184+ /// <code >
185+ /// let arr = [ | 1; 1; 1; 1 |]
186+ /// let sum = [ | 0 |]
187+ /// runExcludeInplace clContext workGroupSize processor arr sum (+) 0
188+ /// |> ignore
189+ /// ...
190+ /// > val arr = [ | 0; 1; 2; 3 |]
191+ /// > val sum = [ | 4 |]
192+ /// </code>
193+ /// </example>
194+ /// <param name="clContext"> ClContext.</param >
195+ /// <param name="workGroupSize"> Should be a power of 2 and greater than 1.</param >
196+ /// <param name="plus"> Associative binary operation.</param >
197+ /// <param name="zero"> Zero element for binary operation.</param >
138198 let runExcludeInPlace plus = PrefixSum.runExcludeInPlace plus
139199
200+ /// <summary >
201+ /// Include in-place prefix sum.
202+ /// </summary >
203+ /// <example >
204+ /// <code >
205+ /// let arr = [ | 1; 1; 1; 1 |]
206+ /// let sum = [ | 0 |]
207+ /// runExcludeInplace clContext workGroupSize processor arr sum (+) 0
208+ /// |> ignore
209+ /// ...
210+ /// > val arr = [ | 0; 1; 2; 3 |]
211+ /// > val sum = [ | 4 |]
212+ /// </code>
213+ /// </example>
214+ /// <param name="clContext"> ClContext.</param >
215+ /// <param name="workGroupSize"> Should be a power of 2 and greater than 1.</param >
216+ /// <param name="plus"> Associative binary operation.</param >
217+ /// <param name="zero"> Zero element for binary operation.</param >
140218 let runIncludeInPlace plus = PrefixSum.runIncludeInPlace plus
141219
220+ /// <summary >
221+ /// Exclude in-place prefix sum. Array is scanned starting from the end.
222+ /// </summary >
223+ /// <param name =" clContext " >ClContext.</param >
224+ /// <param name =" workGroupSize " >Should be a power of 2 and greater than 1.</param >
225+ /// <param name =" plus " >Associative binary operation.</param >
226+ /// <param name =" zero " >Zero element for binary operation.</param >
142227 let runBackwardsExcludeInPlace plus =
143228 PrefixSum.runBackwardsExcludeInPlace plus
144229
230+ /// <summary >
231+ /// Include in-place prefix sum. Array is scanned starting from the end.
232+ /// </summary >
233+ /// <param name =" clContext " >ClContext.</param >
234+ /// <param name =" workGroupSize " >Should be a power of 2 and greater than 1.</param >
235+ /// <param name =" plus " >Associative binary operation.</param >
236+ /// <param name =" zero " >Zero element for binary operation.</param >
145237 let runBackwardsIncludeInPlace plus =
146238 PrefixSum.runBackwardsIncludeInPlace plus
147239
148240 /// <summary >
149- /// Exclude inplace prefix sum.
241+ /// Exclude in-place prefix sum of integer array with addition operation and start value that is equal to 0 .
150242 /// </summary >
151243 /// <example >
152244 /// <code >
@@ -159,10 +251,8 @@ module Common =
159251 /// > val sum = [ | 4 |]
160252 /// </code>
161253 /// </example>
162- ///<param name="clContext"> ClContext.</param >
163- ///<param name="workGroupSize"> Should be a power of 2 and greater than 1.</param >
164- ///<param name="plus"> Associative binary operation.</param >
165- ///<param name="zero"> Zero element for binary operation.</param >
254+ /// <param name="clContext"> ClContext.</param >
255+ /// <param name="workGroupSize"> Should be a power of 2 and greater than 1.</param >
166256 let standardExcludeInPlace ( clContext : ClContext ) workGroupSize =
167257
168258 let scan =
@@ -173,23 +263,21 @@ module Common =
173263 scan processor inputArray 0
174264
175265 /// <summary >
176- /// Include inplace prefix sum.
266+ /// Include in-place prefix sum of integer array with addition operation and start value that is equal to 0 .
177267 /// </summary >
178268 /// <example >
179269 /// <code >
180270 /// let arr = [ | 1; 1; 1; 1 |]
181271 /// let sum = [ | 0 |]
182- /// runExcludeInplace clContext workGroupSize processor arr sum (+) 0
272+ /// runIncludeInplace clContext workGroupSize processor arr sum (+) 0
183273 /// |> ignore
184274 /// ...
185275 /// > val arr = [ | 1; 2; 3; 4 |]
186276 /// > val sum = [ | 4 |]
187277 /// </code>
188278 /// </example>
189- ///<param name="clContext"> ClContext.</param >
190- ///<param name="workGroupSize"> Should be a power of 2 and greater than 1.</param >
191- ///<param name="plus"> Associative binary operation.</param >
192- ///<param name="zero"> Zero element for binary operation.</param >
279+ /// <param name="clContext"> ClContext.</param >
280+ /// <param name="workGroupSize"> Should be a power of 2 and greater than 1.</param >
193281 let standardIncludeInPlace ( clContext : ClContext ) workGroupSize =
194282
195283 let scan =
0 commit comments