Use single class to program load register command

Change-Id: I90fe084409588cb32f0ac43a3db5082047d7a68b
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2020-10-06 10:58:18 +02:00
committed by sys_ocldev
parent 138f04bdcd
commit ce1b669cda
12 changed files with 66 additions and 71 deletions

View File

@@ -80,11 +80,10 @@ void PreemptionHelper::applyPreemptionWaCmdsBegin<GfxFamily>(LinearStream *pComm
if (preemptionMode == PreemptionMode::ThreadGroup ||
preemptionMode == PreemptionMode::MidThread) {
if (device.getHardwareInfo().workaroundTable.waModifyVFEStateAfterGPGPUPreemption) {
auto pCmd = reinterpret_cast<MI_LOAD_REGISTER_IMM *>(pCommandStream->getSpace(sizeof(MI_LOAD_REGISTER_IMM)));
MI_LOAD_REGISTER_IMM cmd = GfxFamily::cmdInitLoadRegisterImm;
cmd.setRegisterOffset(CS_GPR_R0);
cmd.setDataDword(GPGPU_WALKER_COOKIE_VALUE_BEFORE_WALKER);
*pCmd = cmd;
LriHelper<GfxFamily>::program(pCommandStream,
CS_GPR_R0,
GPGPU_WALKER_COOKIE_VALUE_BEFORE_WALKER,
false);
}
}
}
@@ -96,11 +95,10 @@ void PreemptionHelper::applyPreemptionWaCmdsEnd<GfxFamily>(LinearStream *pComman
if (preemptionMode == PreemptionMode::ThreadGroup ||
preemptionMode == PreemptionMode::MidThread) {
if (device.getHardwareInfo().workaroundTable.waModifyVFEStateAfterGPGPUPreemption) {
auto pCmd = reinterpret_cast<MI_LOAD_REGISTER_IMM *>(pCommandStream->getSpace(sizeof(MI_LOAD_REGISTER_IMM)));
MI_LOAD_REGISTER_IMM cmd = GfxFamily::cmdInitLoadRegisterImm;
cmd.setRegisterOffset(CS_GPR_R0);
cmd.setDataDword(GPGPU_WALKER_COOKIE_VALUE_AFTER_WALKER);
*pCmd = cmd;
LriHelper<GfxFamily>::program(pCommandStream,
CS_GPR_R0,
GPGPU_WALKER_COOKIE_VALUE_AFTER_WALKER,
false);
}
}
}