Skip to content

Commit

Permalink
Block after setup and cleanup in benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgarbar committed Dec 17, 2023
1 parent 0826562 commit b82fe68
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/BFS.fs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ type WithoutTransferBenchmark<'elem when 'elem : struct>(
override this.GlobalSetup() =
this.ReadMatrix()
this.LoadMatrixToGPU()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<IterationCleanup>]
override this.IterationCleanup() =
this.ClearResult()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<GlobalCleanup>]
override this.GlobalCleanup() =
Expand Down Expand Up @@ -180,6 +182,7 @@ type WithTransferBenchmark<'elem when 'elem : struct>(
[<GlobalSetup>]
override this.GlobalSetup() =
this.ReadMatrix()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<GlobalCleanup>]
override this.GlobalCleanup() =
Expand All @@ -189,6 +192,7 @@ type WithTransferBenchmark<'elem when 'elem : struct>(
override this.IterationCleanup() =
this.ClearInputMatrix()
this.ClearResult()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<Benchmark>]
override this.Benchmark() =
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/GraphBLAS-sharp.Benchmarks/Algorithms/PageRank.fs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ type PageRankWithoutTransferBenchmarkFloat32() =
this.Processor.PostAndReply(Msg.MsgNotifyMe)
this.PrepareMatrix()
this.ClearInputMatrix()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<IterationCleanup>]
override this.IterationCleanup() =
this.ClearResult()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<GlobalCleanup>]
override this.GlobalCleanup() =
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/Map2/Map2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ module WithTransfer =
[<GlobalSetup>]
override this.GlobalSetup() =
this.ReadMatrices()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<GlobalCleanup>]
override this.GlobalCleanup() = ()
Expand All @@ -259,6 +260,7 @@ module WithTransfer =
override this.IterationCleanup() =
this.ClearInputMatrices()
this.ClearResult()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<Benchmark>]
override this.Benchmark() =
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Expand.fs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ module WithoutTransfer =
override this.GlobalSetup() =
this.ReadMatrices()
this.LoadMatricesToGPU()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<Benchmark>]
override this.Benchmark() =
Expand All @@ -124,6 +125,7 @@ module WithoutTransfer =
[<IterationCleanup>]
override this.IterationCleanup () =
this.ClearResult()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<GlobalCleanup>]
override this.GlobalCleanup () =
Expand Down
4 changes: 4 additions & 0 deletions benchmarks/GraphBLAS-sharp.Benchmarks/Matrix/SpGeMM/Masked.fs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ type MxmBenchmarksMultiplicationOnly<'elem when 'elem : struct>(
this.ReadMatrices ()
this.LoadMatricesToGPU ()
this.ConvertSecondMatrixToCSC()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<Benchmark>]
override this.Benchmark () =
Expand All @@ -161,6 +162,7 @@ type MxmBenchmarksMultiplicationOnly<'elem when 'elem : struct>(
[<IterationCleanup>]
override this.IterationCleanup () =
this.ClearResult()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<GlobalCleanup>]
override this.GlobalCleanup () =
Expand All @@ -182,6 +184,7 @@ type MxmBenchmarksWithTransposing<'elem when 'elem : struct>(
override this.GlobalSetup() =
this.ReadMatrices()
this.LoadMatricesToGPU ()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<Benchmark>]
override this.Benchmark() =
Expand All @@ -194,6 +197,7 @@ type MxmBenchmarksWithTransposing<'elem when 'elem : struct>(
override this.IterationCleanup() =
this.ClearResult()
this.ConvertSecondMatrixToCSR()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<GlobalCleanup>]
override this.GlobalCleanup() =
Expand Down
3 changes: 3 additions & 0 deletions benchmarks/GraphBLAS-sharp.Benchmarks/Vector/Map2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ module WithoutTransfer =
override this.IterationCleanup() =
this.ClearResult()
this.ClearInputVectors()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<GlobalCleanup>]
override this.GlobalCleanup() = ()
Expand Down Expand Up @@ -159,6 +160,7 @@ module WithTransfer =
[<IterationSetup>]
override this.IterationSetup() =
this.CreateVectors()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<Benchmark>]
override this.Benchmark () =
Expand All @@ -175,6 +177,7 @@ module WithTransfer =
override this.IterationCleanup () =
this.ClearInputVectors()
this.ClearResult()
this.Processor.PostAndReply(Msg.MsgNotifyMe)

[<GlobalCleanup>]
override this.GlobalCleanup() = ()
Expand Down

0 comments on commit b82fe68

Please sign in to comment.