mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Source Level Debugger device debugger active flag
- device flag indicating if debugger is active - when active, proper sip kernels must be used Change-Id: I678367cdf8fab5d4b5770e3f471246ff6d6bd112
This commit is contained in:
committed by
sys_ocldev
parent
6bf4135def
commit
9a86f86a24
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "runtime/built_ins/sip.h"
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/helpers/hw_helper.h"
|
||||
#include "runtime/helpers/ptr_math.h"
|
||||
#include "runtime/program/program.h"
|
||||
#include "runtime/helpers/debug_helpers.h"
|
||||
@@ -94,4 +95,9 @@ size_t SipKernel::getBinarySize() const {
|
||||
auto kernelInfo = program->getKernelInfo(size_t{0});
|
||||
return kernelInfo->heapInfo.pKernelHeader->KernelHeapSize - kernelInfo->systemKernelOffset;
|
||||
}
|
||||
|
||||
SipKernelType SipKernel::getSipKernelType(GFXCORE_FAMILY family, bool debuggingActive) {
|
||||
auto &hwHelper = HwHelper::get(family);
|
||||
return hwHelper.getSipKernelType(debuggingActive);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
@@ -61,6 +62,7 @@ class SipKernel {
|
||||
static const size_t maxDbgSurfaceSize;
|
||||
|
||||
GraphicsAllocation *getSipAllocation() const;
|
||||
static SipKernelType getSipKernelType(GFXCORE_FAMILY family, bool debuggingActive);
|
||||
|
||||
protected:
|
||||
SipKernelType type = SipKernelType::COUNT;
|
||||
|
||||
@@ -313,7 +313,8 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
makeResident(*preemptionCsrAllocation);
|
||||
|
||||
if (dispatchFlags.preemptionMode == PreemptionMode::MidThread) {
|
||||
makeResident(*BuiltIns::getInstance().getSipKernel(SipKernelType::Csr, *device).getSipAllocation());
|
||||
auto sipType = SipKernel::getSipKernelType(device->getHardwareInfo().pPlatform->eRenderCoreFamily, device->isSourceLevelDebuggerActive());
|
||||
makeResident(*BuiltIns::getInstance().getSipKernel(sipType, *device).getSipAllocation());
|
||||
}
|
||||
|
||||
// If the CSR has work in its CS, flush it before the task
|
||||
|
||||
@@ -90,7 +90,8 @@ void PreemptionHelper::programPreamble(LinearStream &preambleCmdStream, Device &
|
||||
|
||||
auto sip = reinterpret_cast<STATE_SIP *>(preambleCmdStream.getSpace(sizeof(STATE_SIP)));
|
||||
sip->init();
|
||||
sip->setSystemInstructionPointer(BuiltIns::getInstance().getSipKernel(SipKernelType::Csr, device).getSipAllocation()->getGpuAddressToPatch());
|
||||
auto sipType = SipKernel::getSipKernelType(device.getHardwareInfo().pPlatform->eRenderCoreFamily, device.isSourceLevelDebuggerActive());
|
||||
sip->setSystemInstructionPointer(BuiltIns::getInstance().getSipKernel(sipType, device).getSipAllocation()->getGpuAddressToPatch());
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -254,4 +254,8 @@ double Device::getPlatformHostTimerResolution() const {
|
||||
GFXCORE_FAMILY Device::getRenderCoreFamily() const {
|
||||
return this->getHardwareInfo().pPlatform->eRenderCoreFamily;
|
||||
}
|
||||
|
||||
bool Device::isSourceLevelDebuggerActive() {
|
||||
return deviceInfo.sourceLevelDebuggerActive;
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -133,6 +133,7 @@ class Device : public BaseObject<_cl_device_id> {
|
||||
std::vector<unsigned int> simultaneousInterops;
|
||||
std::string deviceExtensions;
|
||||
bool getEnabled64kbPages();
|
||||
bool isSourceLevelDebuggerActive();
|
||||
|
||||
protected:
|
||||
Device() = delete;
|
||||
|
||||
@@ -352,5 +352,7 @@ void Device::initializeCaps() {
|
||||
deviceInfo.preferredGlobalAtomicAlignment = MemoryConstants::cacheLineSize;
|
||||
deviceInfo.preferredLocalAtomicAlignment = MemoryConstants::cacheLineSize;
|
||||
deviceInfo.preferredPlatformAtomicAlignment = MemoryConstants::cacheLineSize;
|
||||
|
||||
deviceInfo.sourceLevelDebuggerActive = false;
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 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"),
|
||||
@@ -150,5 +150,6 @@ struct DeviceInfo {
|
||||
bool packedYuvExtension;
|
||||
cl_uint internalDriverVersion;
|
||||
bool enabled64kbPages;
|
||||
bool sourceLevelDebuggerActive;
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 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,5 +37,13 @@ bool HwHelperHw<Family>::setupPreemptionRegisters(HardwareInfo *pHwInfo, bool en
|
||||
return pHwInfo->capabilityTable.whitelistedRegisters.csChicken1_0x2580;
|
||||
}
|
||||
|
||||
template <>
|
||||
SipKernelType HwHelperHw<Family>::getSipKernelType(bool debuggingActive) {
|
||||
if (!debuggingActive) {
|
||||
return SipKernelType::Csr;
|
||||
}
|
||||
return SipKernelType::DbgCsrLocal;
|
||||
}
|
||||
|
||||
template class HwHelperHw<Family>;
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#pragma once
|
||||
#include "runtime/gen_common/hw_cmds.h"
|
||||
#include "runtime/command_stream/linear_stream.h"
|
||||
#include "runtime/built_ins/sip.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
@@ -42,6 +43,7 @@ class HwHelper {
|
||||
virtual bool setupPreemptionRegisters(HardwareInfo *pHwInfo, bool enable) = 0;
|
||||
virtual void adjustDefaultEngineType(HardwareInfo *pHwInfo) = 0;
|
||||
virtual void setupHardwareCapabilities(HardwareCapabilities *caps) = 0;
|
||||
virtual SipKernelType getSipKernelType(bool debuggingActive) = 0;
|
||||
|
||||
protected:
|
||||
HwHelper(){};
|
||||
@@ -87,6 +89,8 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
void setupHardwareCapabilities(HardwareCapabilities *caps) override;
|
||||
|
||||
SipKernelType getSipKernelType(bool debuggingActive) override;
|
||||
|
||||
private:
|
||||
HwHelperHw(){};
|
||||
};
|
||||
|
||||
@@ -39,4 +39,11 @@ void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps) {
|
||||
caps->image3DMaxWidth = 16384;
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
SipKernelType HwHelperHw<Family>::getSipKernelType(bool debuggingActive) {
|
||||
if (!debuggingActive) {
|
||||
return SipKernelType::Csr;
|
||||
}
|
||||
return SipKernelType::DbgCsr;
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
Reference in New Issue
Block a user