Skip to content

Commit 86237c9

Browse files
committed
Merge corrections
1 parent 3063225 commit 86237c9

5 files changed

Lines changed: 18 additions & 74 deletions

File tree

src/GraphBLAS-sharp.Backend/GraphBLAS-sharp.Backend.fsproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,17 @@
1919
<Compile Include="Common/Scatter.fs" />
2020
<Compile Include="Common/StandardOperations.fs" />
2121
<Compile Include="Predefined/PrefixSum.fs" />
22-
<Compile Include="Matrices.fs" />
22+
<!--Compile Include="Matrices.fs" /-->
2323
<Compile Include="Masks.fs" />
24-
<Compile Include="Matrix/COOMatrix/COOMatrix.fs" />
2524
<Compile Include="Objects/Common.fs" />
2625
<Compile Include="Objects/ArraysExtentions.fs" />
2726
<Compile Include="Objects/Vector.fs" />
2827
<Compile Include="Objects/Matrix.fs" />
2928
<Compile Include="Matrix/COOMatrix/COOMatrix.fs" />
3029
<Compile Include="Matrix/CSRMatrix/Elementwise.fs" />
31-
<Compile Include="Matrix/CSRMatrix/CSRMatrix.fs" />
3230
<Compile Include="Matrix/CSRMatrix/SpGEMM.fs" />
3331
<Compile Include="Matrix/CSRMatrix/CSRMatrix.fs" />
32+
<Compile Include="Matrix/CSRMatrix/CSRMatrix.fs" />
3433
<Compile Include="Matrix/CSRMatrix/SpMV.fs" />
3534
<Compile Include="Matrix/Matrix.fs" />
3635
<Folder Include="Vector" />

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

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,13 @@ module Matrix =
285285
let CSRElementwise =
286286
CSRMatrix.elementwiseToCOO clContext opAdd workGroupSize
287287

288-
let toCSRInplace =
289-
toCSRInplace clContext workGroupSize
288+
let transposeCOOInplace =
289+
COOMatrix.transposeInplace clContext workGroupSize
290290

291291
fun (processor: MailboxProcessor<_>) matrix1 matrix2 ->
292292
match matrix1, matrix2 with
293293
| MatrixCOO m1, MatrixCOO m2 -> COOElementwise processor m1 m2 |> MatrixCOO
294-
| MatrixCSR m1, MatrixCSR m2 -> CSRElementwise processor m1 m2 |> MatrixCSR
294+
| MatrixCSR m1, MatrixCSR m2 -> CSRElementwise processor m1 m2 |> MatrixCOO
295295
| MatrixCSC m1, MatrixCSC m2 ->
296296
let csrT1 =
297297
{ Context = m1.Context
@@ -310,15 +310,7 @@ module Matrix =
310310
Values = m2.Values }
311311

312312
let resT = CSRElementwise processor csrT1 csrT2
313-
let resCSRT = toCSRInplace procesor resT
314-
315-
{ Context = resCSRT.Context
316-
RowCount = resCSRT.ColumnCount
317-
ColumnCount = resCSRT.RowCount
318-
Rows = resCSRT.Columns
319-
ColumnPointers = resCSRT.RowPointers
320-
Values = resCSRT.Values }
321-
|> MatrixCSC
313+
MatrixCOO <| transposeCOOInplace processor resT
322314
| _ -> failwith "Matrix formats are not matching"
323315

324316
let elementwiseAtLeastOne (clContext: ClContext) (opAdd: Expr<AtLeastOne<'a, 'b> -> 'c option>) workGroupSize =
@@ -367,10 +359,13 @@ module Matrix =
367359
let CSRElementwise =
368360
CSRMatrix.elementwiseAtLeastOneToCOO clContext opAdd workGroupSize
369361

362+
let transposeCOOInplace =
363+
COOMatrix.transposeInplace clContext workGroupSize
364+
370365
fun (processor: MailboxProcessor<_>) matrix1 matrix2 ->
371366
match matrix1, matrix2 with
372367
| MatrixCOO m1, MatrixCOO m2 -> COOElementwise processor m1 m2 |> MatrixCOO
373-
| MatrixCSR m1, MatrixCSR m2 -> CSRElementwise processor m1 m2 |> MatrixCSR
368+
| MatrixCSR m1, MatrixCSR m2 -> CSRElementwise processor m1 m2 |> MatrixCOO
374369
| MatrixCSC m1, MatrixCSC m2 ->
375370
let csrT1 =
376371
{ Context = m1.Context
@@ -389,15 +384,7 @@ module Matrix =
389384
Values = m2.Values }
390385

391386
let resT = CSRElementwise processor csrT1 csrT2
392-
let resCSRT = toCSRInplace procesor resT
393-
394-
{ Context = resCSRT.Context
395-
RowCount = resCSRT.ColumnCount
396-
ColumnCount = resCSRT.RowCount
397-
Rows = resCSRT.Columns
398-
ColumnPointers = resCSRT.RowPointers
399-
Values = resCSRT.Values }
400-
|> MatrixCSC
387+
MatrixCOO <| transposeCOOInplace processor resT
401388
| _ -> failwith "Matrix formats are not matching"
402389

403390
/// <summary>

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@ namespace GraphBLAS.FSharp.Backend
22

33
open Brahma.FSharp
44

5-
<<<<<<< HEAD:src/GraphBLAS-sharp.Backend/Matrices.fs
6-
type IDeviceMemObject =
7-
abstract Dispose : MailboxProcessor<Msg> -> unit
8-
95
type MatrixFormat =
10-
=======
11-
type MatrixFromat =
12-
>>>>>>> 835e7bfee1507ee5c31f5613e175368e7daf00d7:src/GraphBLAS-sharp.Backend/Objects/Matrix.fs
136
| CSR
147
| COO
158
| CSC

tests/GraphBLAS-sharp.Tests/GraphBLAS-sharp.Tests.fsproj

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,16 @@
1717
<Compile Include="BackendCommonTests/CopyTests.fs" />
1818
<Compile Include="BackendCommonTests/ReplicateTests.fs" />
1919
<Compile Include="BackendCommonTests/PrefixSumTests.fs" />
20-
<Compile Include="BackendCommonTests\ScatterTests.fs" />
21-
<Compile Include="BackendCommonTests/MatrixEwiseAddTests.fs" />
20+
<Compile Include="BackendCommonTests/ScatterTests.fs" />
21+
<Compile Include="BackendCommonTests/MatrixElementwiseTests.fs" />
2222
<Compile Include="BackendCommonTests/ConvertTests.fs" />
2323
<Compile Include="BackendCommonTests/TransposeTests.fs" />
2424
<Compile Include="BackendCommonTests/MxmTests.fs" />
2525
<!--Compile Include="MatrixOperationsTests/GetTuplesTests.fs" /-->
26-
<!--Compile Include="MatrixOperationsTests/MxmTests.fs" /-->
2726
<!--Compile Include="MatrixOperationsTests/MxvTests.fs" /-->
2827
<!--Compile Include="MatrixOperationsTests/VxmTests.fs" /-->
29-
<!--Compile Include="MatrixOperationsTests/EWiseAddTests.fs" /-->
30-
<!--Compile Include="MatrixOperationsTests/TransposeTests.fs" /-->
3128
<!--Compile Include="AlgorithmsTests/BfsTests.fs" /-->
3229
<Compile Include="Program.fs" />
3330
</ItemGroup>
3431
<Import Project="..\..\.paket\Paket.Restore.targets" />
35-
</Project>
36-
<PropertyGroup>
37-
<OutputType>Exe</OutputType>
38-
<TargetFramework>net5.0</TargetFramework>
39-
<GenerateProgramFile>false</GenerateProgramFile>
40-
</PropertyGroup>
41-
<ItemGroup>
42-
<ProjectReference Include="../../src/GraphBLAS-sharp/GraphBLAS-sharp.fsproj" />
43-
<ProjectReference Include="../../src/GraphBLAS-sharp.Backend/GraphBLAS-sharp.Backend.fsproj" />
44-
</ItemGroup>
45-
<ItemGroup>
46-
<Compile Include="AssemblyInfo.fs" />
47-
<Compile Include="Helpers.fs" />
48-
<Compile Include="BackendCommonTests/BitonicSortTests.fs" />
49-
<Compile Include="BackendCommonTests/RemoveDuplicatesTests.fs" />
50-
<Compile Include="BackendCommonTests/CopyTests.fs" />
51-
<Compile Include="BackendCommonTests/ReplicateTests.fs" />
52-
<Compile Include="BackendCommonTests/PrefixSumTests.fs" />
53-
<Compile Include="BackendCommonTests/MatrixElementwiseTests.fs" />
54-
<Compile Include="BackendCommonTests/ConvertTests.fs" />
55-
<Compile Include="BackendCommonTests/TransposeTests.fs" />
56-
<!--Compile Include="MatrixOperationsTests/GetTuplesTests.fs" /-->
57-
<!--Compile Include="MatrixOperationsTests/MxmTests.fs" /-->
58-
<!--Compile Include="MatrixOperationsTests/MxvTests.fs" /-->
59-
<!--Compile Include="MatrixOperationsTests/VxmTests.fs" /-->
60-
<!--Compile Include="MatrixOperationsTests/EWiseAddTests.fs" /-->
61-
<!--Compile Include="MatrixOperationsTests/TransposeTests.fs" /-->
62-
<!--Compile Include="AlgorithmsTests/BfsTests.fs" /-->
63-
<Compile Include="Program.fs" />
64-
</ItemGroup>
65-
<Import Project="..\..\.paket\Paket.Restore.targets" />
66-
</Project>
67-
32+
</Project>

tests/GraphBLAS-sharp.Tests/Program.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ let allTests =
1919
Backend.RemoveDuplicates.tests
2020
Backend.Copy.tests
2121
Backend.Replicate.tests
22-
Backend.Elementwise.elementwiseAddTests
23-
Backend.Elementwise.elementwiseAddAtLeastOneTests
24-
Backend.Elementwise.elementwiseAddAtLeastOneToCOOTests
25-
Backend.Elementwise.elementwiseMulAtLeastOneTests
22+
//Backend.Elementwise.elementwiseAddTests
23+
//Backend.Elementwise.elementwiseAddAtLeastOneTests
24+
//Backend.Elementwise.elementwiseAddAtLeastOneToCOOTests
25+
//Backend.Elementwise.elementwiseMulAtLeastOneTests
2626
Backend.Transpose.tests
2727
//Matrix.GetTuples.tests
2828
//Matrix.Mxv.tests

0 commit comments

Comments
 (0)