Improve thread arbitration policy programming

Change-Id: Ibd764352e14d1a5112034b1c5a1fc6d6d67ebac0
This commit is contained in:
Dunajski, Bartosz
2018-02-20 08:11:24 +01:00
committed by sys_ocldev
parent 67c8d7a9ca
commit 1292c3d533
21 changed files with 127 additions and 104 deletions

View File

@@ -64,5 +64,30 @@ void PreambleHelper<SKLFamily>::setupPipeControlInFrontOfCommand(void *pCmd, con
}
}
template struct PreambleHelper<SKLFamily>;
template <>
uint32_t PreambleHelper<SKLFamily>::getDefaultThreadArbitrationPolicy() {
return ThreadArbitrationPolicy::RoundRobin;
}
template <>
void PreambleHelper<SKLFamily>::programThreadArbitration(LinearStream *pCommandStream, uint32_t requiredThreadArbitrationPolicy) {
UNRECOVERABLE_IF(requiredThreadArbitrationPolicy == ThreadArbitrationPolicy::NotPresent);
auto pipeControl = pCommandStream->getSpaceForCmd<PIPE_CONTROL>();
*pipeControl = PIPE_CONTROL::sInit();
pipeControl->setCommandStreamerStallEnable(true);
auto pCmd = pCommandStream->getSpaceForCmd<MI_LOAD_REGISTER_IMM>();
*pCmd = MI_LOAD_REGISTER_IMM::sInit();
pCmd->setRegisterOffset(DebugControlReg2::address);
pCmd->setDataDword(DebugControlReg2::getRegData(requiredThreadArbitrationPolicy));
}
template <>
size_t PreambleHelper<SKLFamily>::getAdditionalCommandsSize(const Device &device) {
return PreemptionHelper::getRequiredPreambleSize<SKLFamily>(device) + sizeof(MI_LOAD_REGISTER_IMM) + sizeof(PIPE_CONTROL);
}
template struct PreambleHelper<SKLFamily>;
} // namespace OCLRT