@@ -57,6 +57,7 @@ bool SuperscalarScheduler::iterate_schedule(const Cancellable* cancellable){
57
57
}
58
58
59
59
if (m_state_changes.empty ()){
60
+ // cout << "State is empty." << endl;
60
61
m_device_sent_time = m_device_issue_time;
61
62
return false ;
62
63
}
@@ -149,7 +150,7 @@ void SuperscalarScheduler::issue_wait_for_all(const Cancellable* cancellable){
149
150
process_schedule (cancellable);
150
151
}
151
152
void SuperscalarScheduler::issue_nop (const Cancellable* cancellable, WallDuration delay){
152
- if (delay = = WallDuration::zero ()){
153
+ if (delay < = WallDuration::zero ()){
153
154
return ;
154
155
}
155
156
if (m_pending_clear.load (std::memory_order_acquire)){
@@ -160,8 +161,9 @@ void SuperscalarScheduler::issue_nop(const Cancellable* cancellable, WallDuratio
160
161
// << ", sent_time = " << std::chrono::duration_cast<Milliseconds>((m_device_sent_time - m_local_start)).count()
161
162
// << ", max_free_time = " << std::chrono::duration_cast<Milliseconds>((m_max_free_time - m_local_start)).count()
162
163
// << endl;
163
- m_state_changes.insert (m_device_issue_time);
164
- m_device_issue_time += delay;
164
+ WallClock next_issue_time = m_device_issue_time + delay;
165
+ m_state_changes.insert (next_issue_time);
166
+ m_device_issue_time = next_issue_time;
165
167
m_max_free_time = std::max (m_max_free_time, m_device_issue_time);
166
168
m_local_last_activity = current_time ();
167
169
process_schedule (cancellable);
@@ -200,6 +202,10 @@ void SuperscalarScheduler::issue_to_resource(
200
202
);
201
203
}
202
204
205
+ delay = std::max (delay, WallDuration::zero ());
206
+ hold = std::max (hold, WallDuration::zero ());
207
+ cooldown = std::max (cooldown, WallDuration::zero ());
208
+
203
209
// cout << "issue_to_resource(): delay = " << std::chrono::duration_cast<Milliseconds>(delay).count()
204
210
// << ", hold = " << std::chrono::duration_cast<Milliseconds>(hold).count()
205
211
// << ", cooldown = " << std::chrono::duration_cast<Milliseconds>(cooldown).count()
0 commit comments