@@ -178,7 +178,7 @@ void ComputeUnit::Issue(FetchBuffer *fetch_buffer)
178
178
" cu=%d "
179
179
" wf=%d "
180
180
" uop_id=%lld "
181
- " stg=\" i \"\n " ,
181
+ " stg=\" s \"\n " ,
182
182
uop->getIdInComputeUnit (),
183
183
index ,
184
184
uop->getWavefront ()->getId (),
@@ -252,24 +252,19 @@ void ComputeUnit::Fetch(FetchBuffer *fetch_buffer,
252
252
// be fetched.
253
253
if (wavefront->getFinished ())
254
254
{
255
- Timing::pipeline_debug << misc::fmt (
256
- " wg=%d/wf=%d "
257
- " Fetch:Finished\n " ,
258
- wavefront->getWorkGroup ()->getId (),
259
- wavefront->getId ());
260
255
continue ;
261
256
}
262
257
263
258
// Wavefront is ready but waiting on outstanding
264
259
// memory instructions
265
- if (wavefront-> isMemoryWait () )
260
+ if (wavefront_pool_entry-> mem_wait )
266
261
{
267
262
// No outstanding accesses
268
263
if (!wavefront_pool_entry->lgkm_cnt &&
269
264
!wavefront_pool_entry->exp_cnt &&
270
265
!wavefront_pool_entry->vm_cnt )
271
266
{
272
- wavefront-> setMemoryWait ( false ) ;
267
+ wavefront_pool_entry-> mem_wait = false ;
273
268
Timing::pipeline_debug << misc::fmt (
274
269
" wg=%d/wf=%d "
275
270
" Mem-wait:Done\n " ,
@@ -354,17 +349,17 @@ void ComputeUnit::Fetch(FetchBuffer *fetch_buffer,
354
349
// Debug
355
350
Timing::pipeline_debug << misc::fmt (
356
351
" wg=%d/wf=%d cu=%d wfPool=%d "
357
- " InstID =%lld asm=%s id_in_wf=%lld\n "
358
- " \t InstID =%lld (Fetch)\n " ,
352
+ " inst =%lld asm=%s id_in_wf=%lld\n "
353
+ " \t inst =%lld (Fetch)\n " ,
359
354
uop->getWavefront ()->getWorkGroup ()->
360
355
getId (),
361
356
uop->getWavefront ()->getId (),
362
357
index ,
363
358
uop->getWavefrontPoolId (),
364
- uop->getIdInComputeUnit (),
359
+ uop->getId (),
365
360
instruction_name.c_str (),
366
361
uop->getIdInWavefront (),
367
- uop->getIdInComputeUnit ());
362
+ uop->getId ());
368
363
}
369
364
370
365
// Update last memory accesses
@@ -407,6 +402,7 @@ void ComputeUnit::Fetch(FetchBuffer *fetch_buffer,
407
402
uop->fetch_ready = timing->getCycle () + fetch_latency;
408
403
409
404
// Insert uop into fetch buffer
405
+ uop->getWorkGroup ()->inflight_instructions ++;
410
406
fetch_buffer->addUop (std::move (uop));
411
407
412
408
instructions_processed++;
@@ -529,6 +525,8 @@ void ComputeUnit::AddWorkGroup(WorkGroup *work_group)
529
525
{
530
526
// Make sure an entry is emptied up
531
527
assert (work_groups[index ] == nullptr );
528
+ assert (work_groups.size () <=
529
+ (unsigned ) gpu->getWorkGroupsPerComputeUnit ());
532
530
533
531
// Set the new work group to the empty entry
534
532
work_groups[index ] = work_group;
@@ -581,10 +579,6 @@ void ComputeUnit::UnmapWorkGroup(WorkGroup *work_group)
581
579
// Unmap wavefronts from instruction buffer
582
580
work_group->wavefront_pool ->UnmapWavefronts (work_group);
583
581
584
- // Remove the work group from the running work groups list
585
- NDRange *ndrange = work_group->getNDRange ();
586
- ndrange->RemoveWorkGroup (work_group);
587
-
588
582
// If compute unit is not already in the available list, place
589
583
// it there. The vector list of work groups does not shrink,
590
584
// when we unmap a workgroup.
@@ -595,6 +589,10 @@ void ComputeUnit::UnmapWorkGroup(WorkGroup *work_group)
595
589
// Trace
596
590
Timing::trace << misc::fmt (" si.unmap_wg cu=%d wg=%d\n " , index ,
597
591
work_group->getId ());
592
+
593
+ // Remove the work group from the running work groups list
594
+ NDRange *ndrange = work_group->getNDRange ();
595
+ ndrange->RemoveWorkGroup (work_group);
598
596
}
599
597
600
598
0 commit comments