P4 to Git Change 1235782 by asalmanp@asalmanp-opencl-stg on 2016/02/09 15:30:16

SWDEV-68792 - [OpenCL][HWS/CWSR] Adding support for Hardware Scheduler and Compute Wave Save restore (CWSR) feature on ORCA

	Adding a temporary w/a for a CP uCode bug in HWS mode. Due to this bug, CP uCode loops through a RUNLIST unless there is a submission on all queues in HWS mode. This causes some overhead and performance drop in PCMark8 on CZ in HWS mode. To work around this issue, it was suggested to submit a dummy packet during initialization on all available queues on HWS mode so that CP uCode can break the loop. This w/a should be removed once CP uCode provides a final fix for this issue.

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/9616/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#160 edit


[ROCm/clr commit: 45715f0c48]
This commit is contained in:
foreman
2016-02-09 17:25:20 -05:00
orang tua 7080c5d4f8
melakukan 027f022623
@@ -583,6 +583,39 @@ CALGSLDevice::PerformFullInitialization_int()
m_textureResource = m_cs->createTextureResource();
m_textureSampler = m_cs->createSampler();
// This is a temporary w/a for a CP uCode bug in HWS mode.
// due to this bug, CP uCode loops through a RUNLIST unless
// there is a submission on all queues in HWS mode.
// To force CP uCode to exit the loop, the below code creates
// temporary contexts and submits a packet (via setRenderState)
// to each available compute engines except the first one which
// already had submission in the above code.
// @todo: remove this code once the bug is fixed in CP uCode
if (m_adp->isHWSSupported()) {
gslEngineID usedComputeEngineID = m_isComputeRingIDForced ?
m_forcedComputeEngineID :
getFirstAvailableComputeEngineID();
for (uint i = 0; i < m_nEngines; ++i) {
if (m_engines[i].id >= GSL_ENGINEID_COMPUTE0 &&
m_engines[i].id <= GSL_ENGINEID_COMPUTE7 &&
m_engines[i].id != usedComputeEngineID) {
gsl::gsCtx* cs_temp;
gslRenderState rs_temp;
cs_temp = m_adp->createComputeContext(m_engines[i].id,
m_canDMA ? GSL_ENGINEID_DRMDMA0 : GSL_ENGINEID_INVALID, false);
cs_temp->getMainSubCtx()->setVPUMask(m_vpuMask);
rs_temp = cs_temp->createRenderState();
cs_temp->setRenderState(rs_temp);
cs_temp->Flush();
cs_temp->setRenderState(0);
cs_temp->destroyRenderState(rs_temp);
m_adp->deleteContext(cs_temp);
}
}
}
}
}