Refactor isDebuggerActive

- use it for SourceLevelDebugger only

Change-Id: I130219a13d6baa1f72c5b35295afd6efa4bf37fa
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2020-10-27 16:00:56 +01:00
committed by sys_ocldev
parent 523887019b
commit ac3b65ba82
15 changed files with 140 additions and 109 deletions

View File

@@ -32,10 +32,10 @@ void PreemptionHelper::programCsrBaseAddress(LinearStream &preambleCmdStream, De
template <typename GfxFamily>
void PreemptionHelper::programStateSip(LinearStream &preambleCmdStream, Device &device) {
using STATE_SIP = typename GfxFamily::STATE_SIP;
bool debuggerActive = device.isDebuggerActive();
bool debuggingEnabled = device.getDebugger() != nullptr || device.isDebuggerActive();
bool isMidThreadPreemption = device.getPreemptionMode() == PreemptionMode::MidThread;
if (isMidThreadPreemption || debuggerActive) {
if (isMidThreadPreemption || debuggingEnabled) {
auto sipAllocation = SipKernel::getSipKernelAllocation(device);
auto sip = reinterpret_cast<STATE_SIP *>(preambleCmdStream.getSpace(sizeof(STATE_SIP)));
@@ -84,8 +84,9 @@ template <typename GfxFamily>
size_t PreemptionHelper::getRequiredStateSipCmdSize(const Device &device) {
size_t size = 0;
bool isMidThreadPreemption = device.getPreemptionMode() == PreemptionMode::MidThread;
bool debuggingEnabled = device.getDebugger() != nullptr || device.isDebuggerActive();
if (isMidThreadPreemption || device.isDebuggerActive()) {
if (isMidThreadPreemption || debuggingEnabled) {
size += sizeof(typename GfxFamily::STATE_SIP);
}
return size;