Skip to content

Commit 0949c73

Browse files
committed
refactor: rename flags to OpenCl terms
1 parent 7b01c8f commit 0949c73

25 files changed

Lines changed: 182 additions & 172 deletions

File tree

benchmarks/GraphBLAS-sharp.Benchmarks/BenchmarksEWiseAdd.fs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ module M =
225225
type EWiseAddBenchmarks4Float32COOWithoutDataTransfer() =
226226

227227
inherit EWiseAddBenchmarksWithoutDataTransfer<ClMatrix.COO<float32>,float32>(
228-
(fun context wgSize -> COOMatrix.elementwise context ArithmeticOperations.float32Sum wgSize CPUInterop),
228+
(fun context wgSize -> COOMatrix.elementwise context ArithmeticOperations.float32Sum wgSize HostInterop),
229229
float32,
230230
(fun _ -> Utils.nextSingle (System.Random())),
231231
Matrix.ToBackendCOO
@@ -237,7 +237,7 @@ type EWiseAddBenchmarks4Float32COOWithoutDataTransfer() =
237237
type EWiseAddBenchmarks4Float32COOWithDataTransfer() =
238238

239239
inherit EWiseAddBenchmarksWithDataTransfer<ClMatrix.COO<float32>,float32>(
240-
(fun context wgSize -> COOMatrix.elementwise context ArithmeticOperations.float32Sum wgSize CPUInterop),
240+
(fun context wgSize -> COOMatrix.elementwise context ArithmeticOperations.float32Sum wgSize HostInterop),
241241
float32,
242242
(fun _ -> Utils.nextSingle (System.Random())),
243243
Matrix.ToBackendCOO<float32>,
@@ -251,7 +251,7 @@ type EWiseAddBenchmarks4Float32COOWithDataTransfer() =
251251
type EWiseAddBenchmarks4BoolCOOWithoutDataTransfer() =
252252

253253
inherit EWiseAddBenchmarksWithoutDataTransfer<ClMatrix.COO<bool>,bool>(
254-
(fun context wgSize -> COOMatrix.elementwise context ArithmeticOperations.boolSum wgSize CPUInterop),
254+
(fun context wgSize -> COOMatrix.elementwise context ArithmeticOperations.boolSum wgSize HostInterop),
255255
(fun _ -> true),
256256
(fun _ -> true),
257257
Matrix.ToBackendCOO<bool>
@@ -264,7 +264,7 @@ type EWiseAddBenchmarks4BoolCOOWithoutDataTransfer() =
264264
type EWiseAddBenchmarks4Float32CSRWithoutDataTransfer() =
265265

266266
inherit EWiseAddBenchmarksWithoutDataTransfer<ClMatrix.CSR<float32>,float32>(
267-
(fun context wgSize -> CSRMatrix.elementwise context ArithmeticOperations.float32Sum wgSize CPUInterop),
267+
(fun context wgSize -> CSRMatrix.elementwise context ArithmeticOperations.float32Sum wgSize HostInterop),
268268
float32,
269269
(fun _ -> Utils.nextSingle (System.Random())),
270270
Matrix.ToBackendCSR
@@ -277,7 +277,7 @@ type EWiseAddBenchmarks4Float32CSRWithoutDataTransfer() =
277277
type EWiseAddBenchmarks4BoolCSRWithoutDataTransfer() =
278278

279279
inherit EWiseAddBenchmarksWithoutDataTransfer<ClMatrix.CSR<bool>,bool>(
280-
(fun context wgSize -> CSRMatrix.elementwise context ArithmeticOperations.boolSum wgSize CPUInterop),
280+
(fun context wgSize -> CSRMatrix.elementwise context ArithmeticOperations.boolSum wgSize HostInterop),
281281
(fun _ -> true),
282282
(fun _ -> true),
283283
Matrix.ToBackendCSR
@@ -291,7 +291,7 @@ type EWiseAddBenchmarks4BoolCSRWithoutDataTransfer() =
291291
type EWiseAddAtLeastOneBenchmarks4BoolCOOWithoutDataTransfer() =
292292

293293
inherit EWiseAddBenchmarksWithoutDataTransfer<ClMatrix.COO<bool>,bool>(
294-
(fun context wgSize -> COOMatrix.elementwiseAtLeastOne context ArithmeticOperations.boolSumAtLeastOne wgSize CPUInterop),
294+
(fun context wgSize -> COOMatrix.elementwiseAtLeastOne context ArithmeticOperations.boolSumAtLeastOne wgSize HostInterop),
295295
(fun _ -> true),
296296
(fun _ -> true),
297297
Matrix.ToBackendCOO<bool>
@@ -303,7 +303,7 @@ type EWiseAddAtLeastOneBenchmarks4BoolCOOWithoutDataTransfer() =
303303
type EWiseAddAtLeastOneBenchmarks4BoolCSRWithoutDataTransfer() =
304304

305305
inherit EWiseAddBenchmarksWithoutDataTransfer<ClMatrix.CSR<bool>,bool>(
306-
(fun context wgSize -> CSRMatrix.elementwiseAtLeastOne context ArithmeticOperations.boolSumAtLeastOne wgSize CPUInterop),
306+
(fun context wgSize -> CSRMatrix.elementwiseAtLeastOne context ArithmeticOperations.boolSumAtLeastOne wgSize HostInterop),
307307
(fun _ -> true),
308308
(fun _ -> true),
309309
Matrix.ToBackendCSR
@@ -315,7 +315,7 @@ type EWiseAddAtLeastOneBenchmarks4BoolCSRWithoutDataTransfer() =
315315
type EWiseAddAtLeastOneBenchmarks4Float32COOWithoutDataTransfer() =
316316

317317
inherit EWiseAddBenchmarksWithoutDataTransfer<ClMatrix.COO<float32>,float32>(
318-
(fun context wgSize -> COOMatrix.elementwiseAtLeastOne context ArithmeticOperations.float32SumAtLeastOne wgSize CPUInterop),
318+
(fun context wgSize -> COOMatrix.elementwiseAtLeastOne context ArithmeticOperations.float32SumAtLeastOne wgSize HostInterop),
319319
float32,
320320
(fun _ -> Utils.nextSingle (System.Random())),
321321
Matrix.ToBackendCOO<float32>
@@ -327,7 +327,7 @@ type EWiseAddAtLeastOneBenchmarks4Float32COOWithoutDataTransfer() =
327327
type EWiseAddAtLeastOneBenchmarks4Float32CSRWithoutDataTransfer() =
328328

329329
inherit EWiseAddBenchmarksWithoutDataTransfer<ClMatrix.CSR<float32>,float32>(
330-
(fun context wgSize -> CSRMatrix.elementwiseAtLeastOne context ArithmeticOperations.float32SumAtLeastOne wgSize CPUInterop),
330+
(fun context wgSize -> CSRMatrix.elementwiseAtLeastOne context ArithmeticOperations.float32SumAtLeastOne wgSize HostInterop),
331331
float32,
332332
(fun _ -> Utils.nextSingle (System.Random())),
333333
Matrix.ToBackendCSR<float32>

benchmarks/GraphBLAS-sharp.Benchmarks/BenchmarksMxm.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ type MxmBenchmarks<'elem when 'elem : struct>(
7575
member this.FunCSR2CSC =
7676
match funCSR2CSC with
7777
| None ->
78-
let x = Matrix.toCSCInplace this.OclContext this.WorkGroupSize CPUInterop
78+
let x = Matrix.toCSCInplace this.OclContext this.WorkGroupSize HostInterop
7979
funCSR2CSC <- Some x
8080
x
8181
| Some x -> x
8282

8383
member this.FunCSC2CSR =
8484
match funCSC2CSR with
8585
| None ->
86-
let x = Matrix.toCSRInplace this.OclContext this.WorkGroupSize CPUInterop
86+
let x = Matrix.toCSRInplace this.OclContext this.WorkGroupSize HostInterop
8787
funCSC2CSR <- Some x
8888
x
8989
| Some x -> x

src/GraphBLAS-sharp.Backend/Algorithms/BFS.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ module BFS =
2323
SpMV.runTo clContext add mul workGroupSize
2424

2525
let zeroCreate =
26-
ClArray.zeroCreate clContext workGroupSize CPUInterop
26+
ClArray.zeroCreate clContext workGroupSize HostInterop
2727

2828
let ofList =
29-
Vector.ofList clContext workGroupSize GPUOnly
29+
Vector.ofList clContext workGroupSize DeviceOnly
3030

3131
let maskComplementedTo =
3232
DenseVector.elementWiseTo clContext Mask.complementedMaskOp workGroupSize

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ module ClArray =
246246
let scatter =
247247
Scatter.runInplace clContext workGroupSize
248248

249-
let getUniqueBitmap = getUniqueBitmap clContext GPUOnly
249+
let getUniqueBitmap = getUniqueBitmap clContext DeviceOnly
250250

251251
let prefixSumExclude =
252-
prefixSumExclude <@ (+) @> clContext workGroupSize GPUOnly
252+
prefixSumExclude <@ (+) @> clContext workGroupSize DeviceOnly
253253

254254
fun (processor: MailboxProcessor<_>) (inputArray: ClArray<'a>) ->
255255

@@ -271,7 +271,7 @@ module ClArray =
271271
a.[0]
272272

273273
let outputArray =
274-
clContext.CreateClArrayWithFlag(GPUOnly, resultLength)
274+
clContext.CreateClArrayWithFlag(DeviceOnly, resultLength)
275275

276276
scatter processor positions inputArray outputArray
277277

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>(GPUOnly, length)
61+
clContext.CreateClArrayWithFlag<int>(DeviceOnly, length)
6262

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

6666
let kernel = kernel.GetKernel()
6767

@@ -218,19 +218,19 @@ module COOMatrix =
218218
let sumOfSides = firstSide + secondSide
219219

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

223223
let allColumns =
224-
clContext.CreateClArrayWithFlag<int>(GPUOnly, sumOfSides)
224+
clContext.CreateClArrayWithFlag<int>(DeviceOnly, sumOfSides)
225225

226226
let leftMergedValues =
227-
clContext.CreateClArrayWithFlag<'a>(GPUOnly, sumOfSides)
227+
clContext.CreateClArrayWithFlag<'a>(DeviceOnly, sumOfSides)
228228

229229
let rightMergedValues =
230-
clContext.CreateClArrayWithFlag<'b>(GPUOnly, sumOfSides)
230+
clContext.CreateClArrayWithFlag<'b>(DeviceOnly, sumOfSides)
231231

232232
let isLeft =
233-
clContext.CreateClArrayWithFlag<int>(GPUOnly, sumOfSides)
233+
clContext.CreateClArrayWithFlag<int>(DeviceOnly, sumOfSides)
234234

235235
let ndRange =
236236
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>(GPUOnly, length)
48+
clContext.CreateClArrayWithFlag<int>(DeviceOnly, length)
4949

5050
let allValues =
51-
clContext.CreateClArrayWithFlag<'c>(GPUOnly, length)
51+
clContext.CreateClArrayWithFlag<'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>(GPUOnly, resLength)
235+
clContext.CreateClArrayWithFlag<int>(DeviceOnly, resLength)
236236

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

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

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

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

249249
let isLeft =
250-
clContext.CreateClArrayWithFlag<int>(GPUOnly, resLength)
250+
clContext.CreateClArrayWithFlag<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>(GPUOnly, mask.NNZ)
113+
context.CreateClArrayWithFlag<'c>(DeviceOnly, mask.NNZ)
114114

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

118118
let kernel = program.GetKernel()
119119

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ open Brahma.FSharp
44

55
module ClContext =
66
type AllocationFlag =
7-
| GPUOnly
8-
| CPUInterop
7+
| DeviceOnly
8+
| HostInterop
99

1010
type ClContext with
1111
member this.CreateClArrayWithFlag(mode, size: int) =
1212
match mode with
13-
| GPUOnly ->
13+
| DeviceOnly ->
1414
this.CreateClArray(
1515
size,
1616
deviceAccessMode = DeviceAccessMode.ReadWrite,
1717
hostAccessMode = HostAccessMode.NotAccessible,
1818
allocationMode = AllocationMode.Default
1919
)
20-
| CPUInterop ->
20+
| HostInterop ->
2121
this.CreateClArray(
2222
size,
2323
deviceAccessMode = DeviceAccessMode.ReadWrite,
@@ -27,14 +27,14 @@ module ClContext =
2727

2828
member this.CreateClArrayWithFlag(mode, array: 'a []) =
2929
match mode with
30-
| GPUOnly ->
30+
| DeviceOnly ->
3131
this.CreateClArray(
3232
array,
3333
deviceAccessMode = DeviceAccessMode.ReadWrite,
3434
hostAccessMode = HostAccessMode.NotAccessible,
3535
allocationMode = AllocationMode.CopyHostPtr
3636
)
37-
| CPUInterop ->
37+
| HostInterop ->
3838
this.CreateClArray(
3939
array,
4040
deviceAccessMode = DeviceAccessMode.ReadWrite,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ module DenseVector =
161161
let kernel = clContext.Compile(getValuesAndIndices)
162162

163163
let getPositions =
164-
getBitmap clContext workGroupSize GPUOnly
164+
getBitmap clContext workGroupSize DeviceOnly
165165

166166
let prefixSum =
167167
PrefixSum.standardExcludeInplace clContext workGroupSize
@@ -224,7 +224,7 @@ module DenseVector =
224224
let reduce<'a when 'a: struct> (clContext: ClContext) workGroupSize (opAdd: Expr<'a -> 'a -> 'a>) =
225225

226226
let getValuesAndIndices =
227-
getValuesAndIndices clContext workGroupSize GPUOnly
227+
getValuesAndIndices clContext workGroupSize DeviceOnly
228228

229229
let reduce =
230230
Reduce.reduce clContext workGroupSize opAdd

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

Lines changed: 1 addition & 1 deletion
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>(GPUOnly, matrixLength)
109+
clContext.CreateClArrayWithFlag<'c option>(DeviceOnly, matrixLength)
110110

111111
let multiplyValues = multiplyValues.GetKernel()
112112

0 commit comments

Comments
 (0)