mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Improve thread arbitration policy programming
Change-Id: Ibd764352e14d1a5112034b1c5a1fc6d6d67ebac0
This commit is contained in:
committed by
sys_ocldev
parent
67c8d7a9ca
commit
1292c3d533
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user