// the last workgroup in the kernel).
bool kernelEnd =
wf->computeUnit->shader->dispatcher().isReachingKernelEnd(wf);
+ // further check whether 'release @ kernel end' is needed
+ bool relNeeded =
+ wf->computeUnit->shader->impl_kern_end_rel;
- // if it is not a kernel end, then retire the workgroup directly
- if (!kernelEnd) {
+ // if not a kernel end or no release needed, retire the workgroup
+ // directly
+ if (!kernelEnd || !relNeeded) {
wf->computeUnit->shader->dispatcher().notifyWgCompl(wf);
wf->setStatus(Wavefront::S_STOPPED);
wf->computeUnit->completedWGs++;
}
/**
- * If it is a kernel end, inject a memory sync and retire the
- * workgroup after receving response.
+ * If a kernel end and release needed, inject a memory sync and
+ * retire the workgroup after receving all acks.
*/
setFlag(MemSync);
setFlag(GlobalSegment);
gpu_cmd_proc = Param.GPUCommandProcessor('Command processor for GPU')
dispatcher = Param.GPUDispatcher('GPU workgroup dispatcher')
n_wf = Param.Int(10, 'Number of wavefront slots per SIMD')
- impl_kern_boundary_sync = Param.Bool(True, """Insert acq/rel packets into
- ruby at kernel boundaries""")
+ impl_kern_launch_acq = Param.Bool(True, """Insert acq packet into
+ ruby at kernel launch""")
+ impl_kern_end_rel = Param.Bool(False, """Insert rel packet into
+ ruby at kernel end""")
globalmem = Param.MemorySize('64kB', 'Memory size')
timing = Param.Bool(False, 'timing memory accesses')
auto task = hsaQueueEntries[exec_id];
bool launched(false);
- // invalidate is needed before starting dispatch
- if (shader->impl_kern_boundary_sync) {
+ // acq is needed before starting dispatch
+ if (shader->impl_kern_launch_acq) {
// try to invalidate cache
shader->prepareInvalidate(task);
} else {
- // kern boundary sync is not set, skip invalidate
+ // kern launch acquire is not set, skip invalidate
task->markInvDone();
}
tickEvent([this]{ execScheduledAdds(); }, "Shader scheduled adds event",
false, Event::CPU_Tick_Pri),
timingSim(p->timing), hsail_mode(SIMT),
- impl_kern_boundary_sync(p->impl_kern_boundary_sync),
+ impl_kern_launch_acq(p->impl_kern_launch_acq),
+ impl_kern_end_rel(p->impl_kern_end_rel),
coissue_return(1),
trace_vgpr_all(1), n_cu((p->CUs).size()), n_wf(p->n_wf),
globalMemSize(p->globalmem),
hsail_mode_e hsail_mode;
// If set, issue acq packet @ kernel launch
- int impl_kern_boundary_sync;
+ int impl_kern_launch_acq;
+ // If set, issue rel packet @ kernel end
+ int impl_kern_end_rel;
// If set, fetch returns may be coissued with instructions
int coissue_return;
// If set, always dump all 64 gprs to trace