Preemption - SIP command programming

Change-Id: I4c7c805a77a9decb8f13d39055bfb2590209ca3e
This commit is contained in:
Chodor, Jaroslaw
2018-01-08 15:58:02 +01:00
committed by sys_ocldev
parent 6272c3ee65
commit d290955a57
28 changed files with 661 additions and 90 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -52,7 +52,7 @@ void CommandStreamReceiverHw<Family>::addDcFlushToPipeControl(Family::PIPE_CONTR
pCmd->setDcFlushEnable(flushDC);
}
template size_t getSizeRequiredPreambleCS<Family>(const HardwareInfo &hwInfo);
template size_t getSizeRequiredPreambleCS<Family>(const Device &hwInfo);
template <>
void populateFactoryTable<CommandStreamReceiverHw<Family>>() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -37,7 +37,7 @@ void PreambleHelper<BDWFamily>::programThreadArbitration(LinearStream *pCommandS
}
template <>
uint32_t PreambleHelper<BDWFamily>::getAdditionalCommandsSize(const HardwareInfo &hwInfo) {
uint32_t PreambleHelper<BDWFamily>::getAdditionalCommandsSize(const Device &device) {
return 0;
}

View File

@@ -35,23 +35,42 @@ static constexpr uint32_t cmdLevelVal = (1 << 2);
}; // namespace PreemptionBDW
template <>
void PreemptionHelper::programCmdStream<GfxFamily>(LinearStream *cmdStream, PreemptionMode &preemptionMode, GraphicsAllocation *preemptionCsr, GraphicsAllocation *sipKernel) {
void PreemptionHelper::programCmdStream<GfxFamily>(LinearStream &cmdStream, PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode,
GraphicsAllocation *preemptionCsr, const LinearStream &ih, const Device &device) {
if (newPreemptionMode == oldPreemptionMode) {
return;
}
uint32_t regVal = 0;
if (preemptionMode == PreemptionMode::ThreadGroup) {
if (newPreemptionMode == PreemptionMode::ThreadGroup) {
regVal = PreemptionBDW::threadGroupVal;
} else {
regVal = PreemptionBDW::cmdLevelVal;
}
LriHelper<GfxFamily>::program(cmdStream, PreemptionBDW::mmioAddress, regVal);
LriHelper<GfxFamily>::program(&cmdStream, PreemptionBDW::mmioAddress, regVal);
}
template <>
size_t PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(PreemptionMode preemptionMode) {
size_t PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode) {
if (newPreemptionMode == oldPreemptionMode) {
return 0;
}
return sizeof(typename GfxFamily::MI_LOAD_REGISTER_IMM);
}
template <>
size_t PreemptionHelper::getRequiredPreambleSize<GfxFamily>(const Device &device) {
return 0;
}
template <>
void PreemptionHelper::programPreamble<GfxFamily>(LinearStream &preambleCmdStream, const Device &device,
const GraphicsAllocation *preemptionCsr) {
}
template size_t PreemptionHelper::getPreemptionWaCsSize<GfxFamily>(const Device &device);
template void PreemptionHelper::applyPreemptionWaCmdsBegin<GfxFamily>(LinearStream *pCommandStream, const Device &device);
template void PreemptionHelper::applyPreemptionWaCmdsEnd<GfxFamily>(LinearStream *pCommandStream, const Device &device);
} // namespace OCLRT