Retrieve state save area header from IGC

Signed-off-by: Matias Cabral <matias.a.cabral@intel.com>
This commit is contained in:
Matias Cabral
2021-03-30 19:31:58 -07:00
committed by Compute-Runtime-Automation
parent d2b6d7f241
commit e35ffb0601
17 changed files with 145 additions and 30 deletions

View File

@@ -38,10 +38,11 @@ const SipKernel &BuiltIns::getSipKernel(SipKernelType type, Device &device) {
auto initializer = [&] {
std::vector<char> sipBinary;
std::vector<char> stateSaveAareHeader;
auto compilerInteface = device.getCompilerInterface();
UNRECOVERABLE_IF(compilerInteface == nullptr);
auto ret = compilerInteface->getSipKernelBinary(device, type, sipBinary);
auto ret = compilerInteface->getSipKernelBinary(device, type, sipBinary, stateSaveAareHeader);
UNRECOVERABLE_IF(ret != TranslationOutput::ErrorCode::Success);
UNRECOVERABLE_IF(sipBinary.size() == 0);
@@ -61,7 +62,7 @@ const SipKernel &BuiltIns::getSipKernel(SipKernelType type, Device &device) {
device, sipAllocation, 0, sipBinary.data(),
sipBinary.size());
}
sipBuiltIn.first.reset(new SipKernel(type, sipAllocation));
sipBuiltIn.first.reset(new SipKernel(type, sipAllocation, std::move(stateSaveAareHeader)));
};
std::call_once(sipBuiltIn.second, initializer);
UNRECOVERABLE_IF(sipBuiltIn.first == nullptr);

View File

@@ -24,13 +24,17 @@ const size_t SipKernel::maxDbgSurfaceSize = 0x1800000; // proper value should be
SipKernel::~SipKernel() = default;
SipKernel::SipKernel(SipKernelType type, GraphicsAllocation *sipAlloc) : type(type), sipAllocation(sipAlloc) {
SipKernel::SipKernel(SipKernelType type, GraphicsAllocation *sipAlloc, std::vector<char> ssah) : type(type), sipAllocation(sipAlloc), stateSaveAreaHeader(ssah) {
}
GraphicsAllocation *SipKernel::getSipAllocation() const {
return sipAllocation;
}
const std::vector<char> &SipKernel::getStateSaveAreaHeader() const {
return stateSaveAreaHeader;
}
SipKernelType SipKernel::getSipKernelType(GFXCORE_FAMILY family, bool debuggingActive) {
auto &hwHelper = HwHelper::get(family);
return hwHelper.getSipKernelType(debuggingActive);
@@ -41,4 +45,10 @@ GraphicsAllocation *SipKernel::getSipKernelAllocation(Device &device) {
auto sipType = SipKernel::getSipKernelType(device.getHardwareInfo().platform.eRenderCoreFamily, debuggingEnabled);
return device.getBuiltIns()->getSipKernel(sipType, device).getSipAllocation();
}
const std::vector<char> &SipKernel::getSipStateSaveAreaHeader(Device &device) {
bool debuggingEnabled = device.getDebugger() != nullptr;
auto sipType = SipKernel::getSipKernelType(device.getHardwareInfo().platform.eRenderCoreFamily, debuggingEnabled);
return device.getBuiltIns()->getSipKernel(sipType, device).getStateSaveAreaHeader();
}
} // namespace NEO

View File

@@ -19,7 +19,7 @@ class GraphicsAllocation;
class SipKernel {
public:
SipKernel(SipKernelType type, GraphicsAllocation *sipAlloc);
SipKernel(SipKernelType type, GraphicsAllocation *sipAlloc, std::vector<char> ssah);
SipKernel(const SipKernel &) = delete;
SipKernel &operator=(const SipKernel &) = delete;
SipKernel(SipKernel &&) = delete;
@@ -33,11 +33,14 @@ class SipKernel {
static const size_t maxDbgSurfaceSize;
MOCKABLE_VIRTUAL GraphicsAllocation *getSipAllocation() const;
MOCKABLE_VIRTUAL const std::vector<char> &getStateSaveAreaHeader() const;
static SipKernelType getSipKernelType(GFXCORE_FAMILY family, bool debuggingActive);
static GraphicsAllocation *getSipKernelAllocation(Device &device);
static const std::vector<char> &getSipStateSaveAreaHeader(Device &device);
protected:
SipKernelType type = SipKernelType::COUNT;
GraphicsAllocation *sipAllocation = nullptr;
const std::vector<char> stateSaveAreaHeader;
};
} // namespace NEO