ruby: Refactor some Event subclasses to lambdas
[gem5.git] / src / mem / ruby / system / GPUCoalescer.cc
index 991b217179a7187163872f1669b626321ea46fcc..a615c40fd1927029b2934b953dca6d46cfbe9eae 100644 (file)
@@ -116,7 +116,10 @@ reqSegmentToHSASegment(Request* req)
 }
 
 GPUCoalescer::GPUCoalescer(const Params *p)
-    : RubyPort(p), issueEvent(this), deadlockCheckEvent(this)
+    : RubyPort(p),
+      issueEvent([this]{ completeIssue(); }, "Issue coalesced request",
+                 false, Event::Progress_Event_Pri),
+      deadlockCheckEvent([this]{ wakeup(); }, "GPUCoalescer deadlock check")
 {
     m_store_waiting_on_load_cycles = 0;
     m_store_waiting_on_store_cycles = 0;
@@ -996,11 +999,6 @@ GPUCoalescer::recordRequestType(SequencerRequestType requestType) {
             SequencerRequestType_to_string(requestType));
 }
 
-GPUCoalescer::IssueEvent::IssueEvent(GPUCoalescer* _seq)
-    : Event(Progress_Event_Pri), seq(_seq)
-{
-}
-
 
 void
 GPUCoalescer::completeIssue()
@@ -1041,18 +1039,6 @@ GPUCoalescer::completeIssue()
     newKernelEnds.clear();
 }
 
-void
-GPUCoalescer::IssueEvent::process()
-{
-    seq->completeIssue();
-}
-
-const char *
-GPUCoalescer::IssueEvent::description() const
-{
-    return "Issue coalesced request";
-}
-
 void
 GPUCoalescer::evictionCallback(Addr address)
 {