Skip to content

Commit 224ddcd

Browse files
committed
refactor: rename Context.CreateArrayWithFlag
1 parent 2ba22eb commit 224ddcd

11 files changed

Lines changed: 57 additions & 57 deletions

File tree

src/GraphBLAS-sharp.Backend/Common/ClArray.fs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module ClArray =
1919

2020
fun (processor: MailboxProcessor<_>) allocationMode (length: int) ->
2121
let outputArray =
22-
clContext.CreateClArrayWithFlag(allocationMode, length)
22+
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, length)
2323

2424
let kernel = program.GetKernel()
2525

@@ -47,7 +47,7 @@ module ClArray =
4747
let value = clContext.CreateClCell(value)
4848

4949
let outputArray =
50-
clContext.CreateClArrayWithFlag(allocationMode, length)
50+
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, length)
5151

5252
let kernel = program.GetKernel()
5353

@@ -82,7 +82,7 @@ module ClArray =
8282
Range1D.CreateValid(inputArray.Length, workGroupSize)
8383

8484
let outputArray =
85-
clContext.CreateClArrayWithFlag(allocationMode, inputArray.Length)
85+
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, inputArray.Length)
8686

8787
let kernel = program.GetKernel()
8888

@@ -110,7 +110,7 @@ module ClArray =
110110
let outputArrayLength = inputArray.Length * count
111111

112112
let outputArray =
113-
clContext.CreateClArrayWithFlag(allocationMode, outputArrayLength)
113+
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, outputArrayLength)
114114

115115
let ndRange =
116116
Range1D.CreateValid(outputArray.Length, workGroupSize)
@@ -227,7 +227,7 @@ module ClArray =
227227
Range1D.CreateValid(inputLength, workGroupSize)
228228

229229
let bitmap =
230-
clContext.CreateClArrayWithFlag(allocationMode, inputLength)
230+
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, inputLength)
231231

232232
let kernel = kernel.GetKernel()
233233

@@ -272,7 +272,7 @@ module ClArray =
272272
a.[0]
273273

274274
let outputArray =
275-
clContext.CreateClArrayWithFlag(DeviceOnly, resultLength)
275+
clContext.CreateClArrayWithSpecificAllocationMode(DeviceOnly, resultLength)
276276

277277
scatter processor positions inputArray outputArray
278278

@@ -322,7 +322,7 @@ module ClArray =
322322
fun (processor: MailboxProcessor<_>) allocationMode (inputArray: ClArray<'a>) ->
323323

324324
let result =
325-
clContext.CreateClArrayWithFlag(allocationMode, inputArray.Length)
325+
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, inputArray.Length)
326326

327327
let ndRange =
328328
Range1D.CreateValid(inputArray.Length, workGroupSize)

src/GraphBLAS-sharp.Backend/Common/Sum.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ module Reduce =
1717
(inputArray.Length - 1) / workGroupSize + 1
1818

1919
let firstVerticesArray =
20-
clContext.CreateClArrayWithFlag(DeviceOnly, firstLength)
20+
clContext.CreateClArrayWithSpecificAllocationMode(DeviceOnly, firstLength)
2121

2222
let secondLength = (firstLength - 1) / workGroupSize + 1
2323

2424
let secondVerticesArray =
25-
clContext.CreateClArrayWithFlag(DeviceOnly, secondLength)
25+
clContext.CreateClArrayWithSpecificAllocationMode(DeviceOnly, secondLength)
2626

2727
let mutable verticesArrays = firstVerticesArray, secondVerticesArray
2828
let swap (a, b) = (b, a)

src/GraphBLAS-sharp.Backend/Matrix/COOMatrix/COOMatrix.fs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ module COOMatrix =
5858
Range1D.CreateValid(length, workGroupSize)
5959

6060
let rawPositionsGpu =
61-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, length)
61+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, length)
6262

6363
let allValues =
64-
clContext.CreateClArrayWithFlag<'c>(DeviceOnly, length)
64+
clContext.CreateClArrayWithSpecificAllocationMode<'c>(DeviceOnly, length)
6565

6666
let kernel = kernel.GetKernel()
6767

@@ -215,19 +215,19 @@ module COOMatrix =
215215
let sumOfSides = firstSide + secondSide
216216

217217
let allRows =
218-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, sumOfSides)
218+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, sumOfSides)
219219

220220
let allColumns =
221-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, sumOfSides)
221+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, sumOfSides)
222222

223223
let leftMergedValues =
224-
clContext.CreateClArrayWithFlag<'a>(DeviceOnly, sumOfSides)
224+
clContext.CreateClArrayWithSpecificAllocationMode<'a>(DeviceOnly, sumOfSides)
225225

226226
let rightMergedValues =
227-
clContext.CreateClArrayWithFlag<'b>(DeviceOnly, sumOfSides)
227+
clContext.CreateClArrayWithSpecificAllocationMode<'b>(DeviceOnly, sumOfSides)
228228

229229
let isLeft =
230-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, sumOfSides)
230+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, sumOfSides)
231231

232232
let ndRange =
233233
Range1D.CreateValid(sumOfSides, workGroupSize)

src/GraphBLAS-sharp.Backend/Matrix/CSRMatrix/Elementwise.fs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ module internal Elementwise =
4545
Range1D.CreateValid(length, workGroupSize)
4646

4747
let rowPositions =
48-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, length)
48+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, length)
4949

5050
let allValues =
51-
clContext.CreateClArrayWithFlag<'c>(DeviceOnly, length)
51+
clContext.CreateClArrayWithSpecificAllocationMode<'c>(DeviceOnly, length)
5252

5353
let kernel = kernel.GetKernel()
5454

@@ -232,22 +232,22 @@ module internal Elementwise =
232232
let resLength = firstLength + secondLength
233233

234234
let allRows =
235-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, resLength)
235+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, resLength)
236236

237237
let allColumns =
238-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, resLength)
238+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, resLength)
239239

240240
let leftMergedValues =
241-
clContext.CreateClArrayWithFlag<'a>(DeviceOnly, resLength)
241+
clContext.CreateClArrayWithSpecificAllocationMode<'a>(DeviceOnly, resLength)
242242

243243
let rightMergedValues =
244-
clContext.CreateClArrayWithFlag<'b>(DeviceOnly, resLength)
244+
clContext.CreateClArrayWithSpecificAllocationMode<'b>(DeviceOnly, resLength)
245245

246246
let isEndOfRow =
247-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, resLength)
247+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, resLength)
248248

249249
let isLeft =
250-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, resLength)
250+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, resLength)
251251

252252
let ndRange =
253253
Range1D.CreateValid((matrixLeftRowPointers.Length - 1) * workGroupSize, workGroupSize)

src/GraphBLAS-sharp.Backend/Matrix/CSRMatrix/SpGEMM.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ module internal SpGEMM =
110110
fun (queue: MailboxProcessor<_>) (matrixLeft: ClMatrix.CSR<'a>) (matrixRight: ClMatrix.CSC<'b>) (mask: ClMask2D) ->
111111

112112
let values =
113-
context.CreateClArrayWithFlag<'c>(DeviceOnly, mask.NNZ)
113+
context.CreateClArrayWithSpecificAllocationMode<'c>(DeviceOnly, mask.NNZ)
114114

115115
let bitmap =
116-
context.CreateClArrayWithFlag<int>(DeviceOnly, mask.NNZ)
116+
context.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, mask.NNZ)
117117

118118
let kernel = program.GetKernel()
119119

src/GraphBLAS-sharp.Backend/Matrix/Common.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ module Common =
3535
res.[0]
3636

3737
let resultRows =
38-
clContext.CreateClArrayWithFlag<int>(allocationMode, resultLength)
38+
clContext.CreateClArrayWithSpecificAllocationMode<int>(allocationMode, resultLength)
3939

4040

4141
let resultColumns =
42-
clContext.CreateClArrayWithFlag<int>(allocationMode, resultLength)
42+
clContext.CreateClArrayWithSpecificAllocationMode<int>(allocationMode, resultLength)
4343

4444
let resultValues =
45-
clContext.CreateClArrayWithFlag(allocationMode, resultLength)
45+
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, resultLength)
4646

4747
indicesScatter processor positions allRows resultRows
4848

src/GraphBLAS-sharp.Backend/Objects/ClContextExtensions.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module ClContext =
88
| HostInterop
99

1010
type ClContext with
11-
member this.CreateClArrayWithFlag(mode, size: int) =
11+
member this.CreateClArrayWithSpecificAllocationMode(mode, size: int) =
1212
match mode with
1313
| DeviceOnly ->
1414
this.CreateClArray(
@@ -25,7 +25,7 @@ module ClContext =
2525
allocationMode = AllocationMode.Default
2626
)
2727

28-
member this.CreateClArrayWithFlag(mode, array: 'a []) =
28+
member this.CreateClArrayWithSpecificAllocationMode(mode, array: 'a []) =
2929
match mode with
3030
| DeviceOnly ->
3131
this.CreateClArray(

src/GraphBLAS-sharp.Backend/Vector/DenseVector/DenseVector.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module DenseVector =
5050

5151
fun (processor: MailboxProcessor<_>) allocationMode (leftVector: ClArray<'a option>) (rightVector: ClArray<'b option>) ->
5252
let resultVector =
53-
clContext.CreateClArrayWithFlag(allocationMode, leftVector.Length)
53+
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, leftVector.Length)
5454

5555
elementWiseTo processor leftVector rightVector resultVector
5656

@@ -100,7 +100,7 @@ module DenseVector =
100100

101101
fun (processor: MailboxProcessor<_>) allocationMode (leftVector: ClArray<'a option>) (maskVector: ClArray<'b option>) (value: ClCell<'a>) ->
102102
let resultVector =
103-
clContext.CreateClArrayWithFlag(allocationMode, leftVector.Length)
103+
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, leftVector.Length)
104104

105105
fillSubVectorTo processor leftVector maskVector value resultVector
106106

@@ -125,7 +125,7 @@ module DenseVector =
125125

126126
fun (processor: MailboxProcessor<_>) allocationMode (vector: ClArray<'a option>) ->
127127
let positions =
128-
clContext.CreateClArrayWithFlag(allocationMode, vector.Length)
128+
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, vector.Length)
129129

130130
let ndRange =
131131
Range1D.CreateValid(vector.Length, workGroupSize)
@@ -183,10 +183,10 @@ module DenseVector =
183183
res.[0]
184184

185185
let resultValues =
186-
clContext.CreateClArrayWithFlag<'a>(allocationMode, resultLength)
186+
clContext.CreateClArrayWithSpecificAllocationMode<'a>(allocationMode, resultLength)
187187

188188
let resultIndices =
189-
clContext.CreateClArrayWithFlag<int>(allocationMode, resultLength)
189+
clContext.CreateClArrayWithSpecificAllocationMode<int>(allocationMode, resultLength)
190190

191191
let ndRange =
192192
Range1D.CreateValid(vector.Length, workGroupSize)

src/GraphBLAS-sharp.Backend/Vector/SpMV.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ module SpMV =
106106
Range1D.CreateValid(matrix.RowCount, workGroupSize)
107107

108108
let intermediateArray =
109-
clContext.CreateClArrayWithFlag<'c option>(DeviceOnly, matrixLength)
109+
clContext.CreateClArrayWithSpecificAllocationMode<'c option>(DeviceOnly, matrixLength)
110110

111111
let multiplyValues = multiplyValues.GetKernel()
112112

@@ -152,7 +152,7 @@ module SpMV =
152152
fun (queue: MailboxProcessor<_>) allocationMode (matrix: ClMatrix.CSR<'a>) (vector: ClArray<'b option>) ->
153153

154154
let result =
155-
clContext.CreateClArrayWithFlag<'b option>(allocationMode, matrix.RowCount)
155+
clContext.CreateClArrayWithSpecificAllocationMode<'b option>(allocationMode, matrix.RowCount)
156156

157157
runTo queue matrix vector result
158158

src/GraphBLAS-sharp.Backend/Vector/SparseVector/SparseVector.fs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ module SparseVector =
4040
res.[0]
4141

4242
let resultValues =
43-
clContext.CreateClArrayWithFlag<'a>(allocationMode, resultLength)
43+
clContext.CreateClArrayWithSpecificAllocationMode<'a>(allocationMode, resultLength)
4444

4545
let resultIndices =
46-
clContext.CreateClArrayWithFlag<int>(allocationMode, resultLength)
46+
clContext.CreateClArrayWithSpecificAllocationMode<int>(allocationMode, resultLength)
4747

4848
valuesScatter processor positions allValues resultValues
4949

@@ -61,13 +61,13 @@ module SparseVector =
6161
fun (processor: MailboxProcessor<_>) (vectorLenght: int) (leftValues: ClArray<'a>) (leftIndices: ClArray<int>) (rightValues: ClArray<'b>) (rightIndices: ClArray<int>) ->
6262

6363
let resultBitmap =
64-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, vectorLenght)
64+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, vectorLenght)
6565

6666
let resultIndices =
67-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, vectorLenght)
67+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, vectorLenght)
6868

6969
let resultValues =
70-
clContext.CreateClArrayWithFlag<'c>(DeviceOnly, vectorLenght)
70+
clContext.CreateClArrayWithSpecificAllocationMode<'c>(DeviceOnly, vectorLenght)
7171

7272
let ndRange =
7373
Range1D.CreateValid(vectorLenght, workGroupSize)
@@ -144,16 +144,16 @@ module SparseVector =
144144
firstIndices.Length + secondIndices.Length
145145

146146
let allIndices =
147-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, sumOfSides)
147+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, sumOfSides)
148148

149149
let firstResultValues =
150-
clContext.CreateClArrayWithFlag<'a>(DeviceOnly, sumOfSides)
150+
clContext.CreateClArrayWithSpecificAllocationMode<'a>(DeviceOnly, sumOfSides)
151151

152152
let secondResultValues =
153-
clContext.CreateClArrayWithFlag<'b>(DeviceOnly, sumOfSides)
153+
clContext.CreateClArrayWithSpecificAllocationMode<'b>(DeviceOnly, sumOfSides)
154154

155155
let isLeftBitmap =
156-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, sumOfSides)
156+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, sumOfSides)
157157

158158
let ndRange =
159159
Range1D.CreateValid(sumOfSides, workGroupSize)
@@ -196,10 +196,10 @@ module SparseVector =
196196
let length = allIndices.Length
197197

198198
let allValues =
199-
clContext.CreateClArrayWithFlag<'c>(DeviceOnly, length)
199+
clContext.CreateClArrayWithSpecificAllocationMode<'c>(DeviceOnly, length)
200200

201201
let positions =
202-
clContext.CreateClArrayWithFlag<int>(DeviceOnly, length)
202+
clContext.CreateClArrayWithSpecificAllocationMode<int>(DeviceOnly, length)
203203

204204
let ndRange =
205205
Range1D.CreateValid(length, workGroupSize)
@@ -269,10 +269,10 @@ module SparseVector =
269269
let length = allIndices.Length
270270

271271
let allValues =
272-
clContext.CreateClArrayWithFlag<'a>(DeviceOnly, length)
272+
clContext.CreateClArrayWithSpecificAllocationMode<'a>(DeviceOnly, length)
273273

274274
let positions =
275-
clContext.CreateClArrayWithFlag(DeviceOnly, length)
275+
clContext.CreateClArrayWithSpecificAllocationMode(DeviceOnly, length)
276276

277277
let ndRange =
278278
Range1D.CreateValid(length, workGroupSize)

0 commit comments

Comments
 (0)