Skip to content

Commit be8c888

Browse files
committed
refactor: namespace/module names
1 parent 4c21e7e commit be8c888

40 files changed

Lines changed: 224 additions & 199 deletions

File tree

benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/BFS.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ open System.IO
44
open BenchmarkDotNet.Attributes
55
open Microsoft.FSharp.Core
66
open Brahma.FSharp
7+
open GraphBLAS.FSharp
78
open GraphBLAS.FSharp.IO
8-
open GraphBLAS.FSharp.Algorithms
99
open GraphBLAS.FSharp.Benchmarks
1010
open GraphBLAS.FSharp.Objects
1111
open GraphBLAS.FSharp.Objects.ArraysExtensions
@@ -127,7 +127,7 @@ type WithoutTransferBenchmark<'elem when 'elem : struct>(
127127
type BFSWithoutTransferBenchmarkInt32() =
128128

129129
inherit WithoutTransferBenchmark<int>(
130-
(singleSourceBFS ArithmeticOperations.intSumOption ArithmeticOperations.intMulOption),
130+
(Algorithms.singleSourceBFS ArithmeticOperations.intSumOption ArithmeticOperations.intMulOption),
131131
int32,
132132
(fun _ -> Utils.nextInt (System.Random())),
133133
0,
@@ -173,7 +173,7 @@ type WithTransferBenchmark<'elem when 'elem : struct>(
173173
type BFSWithTransferBenchmarkInt32() =
174174

175175
inherit WithTransferBenchmark<int>(
176-
(singleSourceBFS ArithmeticOperations.intSumOption ArithmeticOperations.intMulOption),
176+
(Algorithms.singleSourceBFS ArithmeticOperations.intSumOption ArithmeticOperations.intMulOption),
177177
int32,
178178
(fun _ -> Utils.nextInt (System.Random())),
179179
0,

benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/Map2/Map2.fs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ namespace GraphBLAS.FSharp.Benchmarks.Matrix.Map2
33
open System.IO
44
open BenchmarkDotNet.Attributes
55
open Brahma.FSharp
6+
open GraphBLAS.FSharp
67
open GraphBLAS.FSharp.IO
7-
open GraphBLAS.FSharp.Operations
88
open GraphBLAS.FSharp.Objects
99
open GraphBLAS.FSharp.Objects.MatrixExtensions
1010
open GraphBLAS.FSharp.Objects.ClContextExtensions
@@ -137,7 +137,7 @@ module WithoutTransfer =
137137
type Float32() =
138138

139139
inherit Benchmark<ClMatrix.COO<float32>,float32>(
140-
(Matrix.map2 ArithmeticOperations.float32SumOption),
140+
(Operations.Matrix.map2 ArithmeticOperations.float32SumOption),
141141
float32,
142142
(fun _ -> Utils.nextSingle (System.Random())),
143143
Matrix.COO
@@ -149,7 +149,7 @@ module WithoutTransfer =
149149
type Bool() =
150150

151151
inherit Benchmark<ClMatrix.COO<bool>,bool>(
152-
(Matrix.map2 ArithmeticOperations.boolSumOption),
152+
(Operations.Matrix.map2 ArithmeticOperations.boolSumOption),
153153
(fun _ -> true),
154154
(fun _ -> true),
155155
Matrix.COO
@@ -162,7 +162,7 @@ module WithoutTransfer =
162162
type Float32() =
163163

164164
inherit Benchmark<ClMatrix.CSR<float32>,float32>(
165-
(Matrix.map2 ArithmeticOperations.float32SumOption),
165+
(Operations.Matrix.map2 ArithmeticOperations.float32SumOption),
166166
float32,
167167
(fun _ -> Utils.nextSingle (System.Random())),
168168
(fun matrix -> Matrix.CSR matrix.ToCSR)
@@ -174,7 +174,7 @@ module WithoutTransfer =
174174
type Bool() =
175175

176176
inherit Benchmark<ClMatrix.CSR<bool>,bool>(
177-
(Matrix.map2 ArithmeticOperations.boolSumOption),
177+
(Operations.Matrix.map2 ArithmeticOperations.boolSumOption),
178178
(fun _ -> true),
179179
(fun _ -> true),
180180
(fun matrix -> Matrix.CSR matrix.ToCSR)
@@ -188,7 +188,7 @@ module WithoutTransfer =
188188
type Bool() =
189189

190190
inherit Benchmark<ClMatrix.COO<bool>,bool>(
191-
(Matrix.map2AtLeastOne ArithmeticOperations.boolSumAtLeastOne),
191+
(Operations.Matrix.map2AtLeastOne ArithmeticOperations.boolSumAtLeastOne),
192192
(fun _ -> true),
193193
(fun _ -> true),
194194
Matrix.COO
@@ -200,7 +200,7 @@ module WithoutTransfer =
200200
type Float32() =
201201

202202
inherit Benchmark<ClMatrix.COO<float32>,float32>(
203-
(Matrix.map2AtLeastOne ArithmeticOperations.float32SumAtLeastOne),
203+
(Operations.Matrix.map2AtLeastOne ArithmeticOperations.float32SumAtLeastOne),
204204
float32,
205205
(fun _ -> Utils.nextSingle (System.Random())),
206206
Matrix.COO
@@ -213,7 +213,7 @@ module WithoutTransfer =
213213
type Bool() =
214214

215215
inherit Benchmark<ClMatrix.CSR<bool>,bool>(
216-
(Matrix.map2AtLeastOne ArithmeticOperations.boolSumAtLeastOne),
216+
(Operations.Matrix.map2AtLeastOne ArithmeticOperations.boolSumAtLeastOne),
217217
(fun _ -> true),
218218
(fun _ -> true),
219219
(fun matrix -> Matrix.CSR matrix.ToCSR)
@@ -225,7 +225,7 @@ module WithoutTransfer =
225225
type Float32() =
226226

227227
inherit Benchmark<ClMatrix.CSR<float32>,float32>(
228-
(Matrix.map2AtLeastOne ArithmeticOperations.float32SumAtLeastOne),
228+
(Operations.Matrix.map2AtLeastOne ArithmeticOperations.float32SumAtLeastOne),
229229
float32,
230230
(fun _ -> Utils.nextSingle (System.Random())),
231231
(fun matrix -> Matrix.CSR matrix.ToCSR)
@@ -272,7 +272,7 @@ module WithTransfer =
272272
type Float32() =
273273

274274
inherit Benchmark<ClMatrix.COO<float32>,float32>(
275-
(Matrix.map2 ArithmeticOperations.float32SumOption),
275+
(Operations.Matrix.map2 ArithmeticOperations.float32SumOption),
276276
float32,
277277
(fun _ -> Utils.nextSingle (System.Random())),
278278
Matrix.COO,

benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Expand.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module GraphBLAS.FSharp.Benchmarks.Matrix.SpGeMM.Expand
33
open System.IO
44
open BenchmarkDotNet.Attributes
55
open Brahma.FSharp
6+
open GraphBLAS.FSharp
67
open GraphBLAS.FSharp.IO
7-
open GraphBLAS.FSharp.Operations
88
open GraphBLAS.FSharp.Backend.Quotes
99
open GraphBLAS.FSharp.Objects
1010
open GraphBLAS.FSharp.Objects.ClContextExtensions
@@ -137,7 +137,7 @@ module WithoutTransfer =
137137
type Float32() =
138138

139139
inherit Benchmark<float32>(
140-
SpGeMM.expand (fst ArithmeticOperations.float32Add) (fst ArithmeticOperations.float32Mul),
140+
Operations.SpGeMM.expand (fst ArithmeticOperations.float32Add) (fst ArithmeticOperations.float32Mul),
141141
float32,
142142
(fun _ -> Utils.nextSingle (System.Random())),
143143
(fun context matrix -> ClMatrix.CSR <| matrix.ToCSR.ToDevice context)

benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Masked.fs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ open GraphBLAS.FSharp.IO
66
open BenchmarkDotNet.Attributes
77
open Brahma.FSharp
88
open GraphBLAS.FSharp
9-
open GraphBLAS.FSharp.Operations
109
open GraphBLAS.FSharp.Objects
1110
open GraphBLAS.FSharp.Objects.ClContextExtensions
1211
open GraphBLAS.FSharp.Benchmarks
@@ -203,7 +202,7 @@ type MxmBenchmarksWithTransposing<'elem when 'elem : struct>(
203202
type Mxm4Float32MultiplicationOnlyBenchmark() =
204203

205204
inherit MxmBenchmarksMultiplicationOnly<float32>(
206-
SpGeMM.masked (fst ArithmeticOperations.float32Add) (fst ArithmeticOperations.float32Mul),
205+
Operations.SpGeMM.masked (fst ArithmeticOperations.float32Add) (fst ArithmeticOperations.float32Mul),
207206
float32,
208207
(fun _ -> Utils.nextSingle (System.Random())),
209208
(fun context matrix -> ClMatrix.CSR <| matrix.ToCSR.ToDevice context)
@@ -215,7 +214,7 @@ type Mxm4Float32MultiplicationOnlyBenchmark() =
215214
type Mxm4Float32WithTransposingBenchmark() =
216215

217216
inherit MxmBenchmarksWithTransposing<float32>(
218-
SpGeMM.masked (fst ArithmeticOperations.float32Add) (fst ArithmeticOperations.float32Mul),
217+
Operations.SpGeMM.masked (fst ArithmeticOperations.float32Add) (fst ArithmeticOperations.float32Mul),
219218
float32,
220219
(fun _ -> Utils.nextSingle (System.Random())),
221220
(fun context matrix -> ClMatrix.CSR <| matrix.ToCSR.ToDevice context)
@@ -227,7 +226,7 @@ type Mxm4Float32WithTransposingBenchmark() =
227226
type Mxm4BoolMultiplicationOnlyBenchmark() =
228227

229228
inherit MxmBenchmarksMultiplicationOnly<bool>(
230-
(SpGeMM.masked (fst ArithmeticOperations.boolAdd) (fst ArithmeticOperations.boolMul)),
229+
(Operations.SpGeMM.masked (fst ArithmeticOperations.boolAdd) (fst ArithmeticOperations.boolMul)),
231230
(fun _ -> true),
232231
(fun _ -> true),
233232
(fun context matrix -> ClMatrix.CSR <| matrix.ToCSR.ToDevice context)
@@ -239,7 +238,7 @@ type Mxm4BoolMultiplicationOnlyBenchmark() =
239238
type Mxm4BoolWithTransposingBenchmark() =
240239

241240
inherit MxmBenchmarksWithTransposing<bool>(
242-
(SpGeMM.masked (fst ArithmeticOperations.boolAdd) (fst ArithmeticOperations.boolMul)),
241+
(Operations.SpGeMM.masked (fst ArithmeticOperations.boolAdd) (fst ArithmeticOperations.boolMul)),
243242
(fun _ -> true),
244243
(fun _ -> true),
245244
(fun context matrix -> ClMatrix.CSR <| matrix.ToCSR.ToDevice context)
@@ -251,7 +250,7 @@ type Mxm4BoolWithTransposingBenchmark() =
251250
type Mxm4Float32MultiplicationOnlyWithZerosFilterBenchmark() =
252251

253252
inherit MxmBenchmarksMultiplicationOnly<float32>(
254-
(SpGeMM.masked (fst ArithmeticOperations.float32Add) (fst ArithmeticOperations.float32Mul)),
253+
(Operations.SpGeMM.masked (fst ArithmeticOperations.float32Add) (fst ArithmeticOperations.float32Mul)),
255254
float32,
256255
(fun _ -> Utils.nextSingle (System.Random())),
257256
(fun context matrix -> ClMatrix.CSR <| matrix.ToCSR.ToDevice context)
@@ -263,7 +262,7 @@ type Mxm4Float32MultiplicationOnlyWithZerosFilterBenchmark() =
263262
type Mxm4Float32WithTransposingWithZerosFilterBenchmark() =
264263

265264
inherit MxmBenchmarksWithTransposing<float32>(
266-
SpGeMM.masked (fst ArithmeticOperations.float32Add) (fst ArithmeticOperations.float32Mul),
265+
Operations.SpGeMM.masked (fst ArithmeticOperations.float32Add) (fst ArithmeticOperations.float32Mul),
267266
float32,
268267
(fun _ -> Utils.nextSingle (System.Random())),
269268
(fun context matrix -> ClMatrix.CSR <| matrix.ToCSR.ToDevice context)

benchmarks/GraphBLAS-sharp.Benchmarks/Vector/Map2.fs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ open FsCheck
44
open BenchmarkDotNet.Attributes
55
open Brahma.FSharp
66
open GraphBLAS.FSharp.Backend.Quotes
7-
open GraphBLAS.FSharp.Operations
7+
open GraphBLAS.FSharp
88
open GraphBLAS.FSharp.Benchmarks
99
open GraphBLAS.FSharp.Tests
1010
open GraphBLAS.FSharp.Objects
@@ -120,26 +120,26 @@ module WithoutTransfer =
120120
type Float() =
121121

122122
inherit Benchmark<float>(
123-
(Vector.map2 ArithmeticOperations.floatSumOption),
123+
(Operations.Vector.map2 ArithmeticOperations.floatSumOption),
124124
VectorGenerator.floatPair Sparse)
125125

126126
type Int32() =
127127

128128
inherit Benchmark<int32>(
129-
(Vector.map2 ArithmeticOperations.intSumOption),
129+
(Operations.Vector.map2 ArithmeticOperations.intSumOption),
130130
VectorGenerator.intPair Sparse)
131131

132132
module AtLeastOne =
133133
type Float() =
134134

135135
inherit Benchmark<float>(
136-
(Vector.map2AtLeastOne ArithmeticOperations.floatSumAtLeastOne),
136+
(Operations.Vector.map2AtLeastOne ArithmeticOperations.floatSumAtLeastOne),
137137
VectorGenerator.floatPair Sparse)
138138

139139
type Int32() =
140140

141141
inherit Benchmark<int32>(
142-
(Vector.map2AtLeastOne ArithmeticOperations.intSumAtLeastOne),
142+
(Operations.Vector.map2AtLeastOne ArithmeticOperations.intSumAtLeastOne),
143143
VectorGenerator.intPair Sparse)
144144

145145
module WithTransfer =
@@ -176,24 +176,24 @@ module WithTransfer =
176176
type Float() =
177177

178178
inherit Benchmark<float>(
179-
(Vector.map2 ArithmeticOperations.floatSumOption),
179+
(Operations.Vector.map2 ArithmeticOperations.floatSumOption),
180180
VectorGenerator.floatPair Sparse)
181181

182182
type Int32() =
183183

184184
inherit Benchmark<int32>(
185-
(Vector.map2 ArithmeticOperations.intSumOption),
185+
(Operations.Vector.map2 ArithmeticOperations.intSumOption),
186186
VectorGenerator.intPair Sparse)
187187

188188
module AtLeastOne =
189189
type Float() =
190190

191191
inherit Benchmark<float>(
192-
(Vector.map2AtLeastOne ArithmeticOperations.floatSumAtLeastOne),
192+
(Operations.Vector.map2AtLeastOne ArithmeticOperations.floatSumAtLeastOne),
193193
VectorGenerator.floatPair Sparse)
194194

195195
type Int32() =
196196

197197
inherit Benchmark<int32>(
198-
(Vector.map2AtLeastOne ArithmeticOperations.intSumAtLeastOne),
198+
(Operations.Vector.map2AtLeastOne ArithmeticOperations.intSumAtLeastOne),
199199
VectorGenerator.intPair Sparse)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
namespace GraphBLAS.FSharp
22

3+
open Microsoft.FSharp.Core
34
open GraphBLAS.FSharp.Backend.Algorithms
45

6+
[<RequireQualifiedAccess>]
57
module Algorithms =
68
let singleSourceBFS = BFS.singleSource

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ open FSharp.Quotations
55
open GraphBLAS.FSharp
66
open GraphBLAS.FSharp.Objects
77
open GraphBLAS.FSharp.Backend.Quotes
8-
open GraphBLAS.FSharp.Operations
98
open GraphBLAS.FSharp.Backend.Vector.Dense
109
open GraphBLAS.FSharp.Objects.ClContextExtensions
1110
open GraphBLAS.FSharp.Objects.ArraysExtensions
@@ -20,7 +19,7 @@ module internal BFS =
2019
=
2120

2221
let spMVTo =
23-
SpMVInplace add mul clContext workGroupSize
22+
Operations.SpMVInplace add mul clContext workGroupSize
2423

2524
let zeroCreate =
2625
ClArray.zeroCreate clContext workGroupSize

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ open GraphBLAS.FSharp.Objects.ArraysExtensions
88
open GraphBLAS.FSharp.Objects.ClContextExtensions
99
open GraphBLAS.FSharp.Objects.ClCellExtensions
1010

11+
[<RequireQualifiedAccess>]
1112
module ClArray =
1213
/// <summary>
1314
/// Creates an array given the dimension and a generator function to compute the elements.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ open Brahma.FSharp
44
open Microsoft.FSharp.Quotations
55
open GraphBLAS.FSharp.Backend.Common
66

7+
[<RequireQualifiedAccess>]
78
module Common =
89
module Bitonic =
910
/// <summary>

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ namespace GraphBLAS.FSharp.Backend.Matrix.COO
22

33
open Brahma.FSharp
44
open GraphBLAS.FSharp
5-
open GraphBLAS.FSharp.Common
65
open GraphBLAS.FSharp.Backend.Quotes
76
open Microsoft.FSharp.Quotations
87
open GraphBLAS.FSharp.Objects
@@ -63,7 +62,7 @@ module Matrix =
6362
let create = ClArray.create clContext workGroupSize
6463

6564
let scan =
66-
PrefixSum.runBackwardsIncludeInPlace <@ min @> clContext workGroupSize
65+
Common.PrefixSum.runBackwardsIncludeInPlace <@ min @> clContext workGroupSize
6766

6867
fun (processor: MailboxProcessor<_>) allocationMode (rowIndices: ClArray<int>) rowCount ->
6968

@@ -125,7 +124,7 @@ module Matrix =
125124
let transposeInPlace (clContext: ClContext) workGroupSize =
126125

127126
let sort =
128-
Bitonic.sortKeyValuesInplace clContext workGroupSize
127+
Common.Bitonic.sortKeyValuesInplace clContext workGroupSize
129128

130129
fun (queue: MailboxProcessor<_>) (matrix: ClMatrix.COO<'a>) ->
131130
sort queue matrix.Columns matrix.Rows matrix.Values

0 commit comments

Comments
 (0)