Refactor SipKernel

- add debug bindless SipKernelType

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-10-18 15:59:47 +00:00
committed by Compute-Runtime-Automation
parent d79317da35
commit 2fb8edb69f
14 changed files with 69 additions and 40 deletions

View File

@@ -31,10 +31,6 @@ BuiltIns::BuiltIns() {
BuiltIns::~BuiltIns() = default;
const SipKernel &BuiltIns::getSipKernel(SipKernelType type, Device &device) {
return getSipKernel(type, false, device);
}
const SipKernel &BuiltIns::getSipKernel(SipKernelType type, bool bindlessSip, Device &device) {
uint32_t kernelId = static_cast<uint32_t>(type);
UNRECOVERABLE_IF(kernelId >= static_cast<uint32_t>(SipKernelType::COUNT));
auto &sipBuiltIn = this->sipKernels[kernelId];
@@ -45,7 +41,7 @@ const SipKernel &BuiltIns::getSipKernel(SipKernelType type, bool bindlessSip, De
auto compilerInteface = device.getCompilerInterface();
UNRECOVERABLE_IF(compilerInteface == nullptr);
auto ret = compilerInteface->getSipKernelBinary(device, type, bindlessSip, sipBinary, stateSaveAreaHeader);
auto ret = compilerInteface->getSipKernelBinary(device, type, sipBinary, stateSaveAreaHeader);
UNRECOVERABLE_IF(ret != TranslationOutput::ErrorCode::Success);
UNRECOVERABLE_IF(sipBinary.size() == 0);

View File

@@ -154,7 +154,6 @@ class BuiltIns {
virtual ~BuiltIns();
MOCKABLE_VIRTUAL const SipKernel &getSipKernel(SipKernelType type, Device &device);
MOCKABLE_VIRTUAL const SipKernel &getSipKernel(SipKernelType type, bool bindlessSip, Device &device);
MOCKABLE_VIRTUAL void freeSipKernels(MemoryManager *memoryManager);
BuiltinsLib &getBuiltinsLib() {

View File

@@ -254,8 +254,15 @@ const SipKernel &SipKernel::getSipKernelImpl(Device &device) {
}
const SipKernel &SipKernel::getBindlessDebugSipKernel(Device &device) {
auto debugSipType = SipKernel::getSipKernelType(device, true);
return device.getBuiltIns()->getSipKernel(debugSipType, true, device);
auto debugSipType = SipKernelType::DbgBindless;
SipKernel::initSipKernelImpl(debugSipType, device);
switch (SipKernel::classType) {
case SipClassType::RawBinaryFromFile:
return *device.getRootDeviceEnvironment().sipKernels[static_cast<uint32_t>(debugSipType)].get();
default:
return device.getBuiltIns()->getSipKernel(debugSipType, device);
}
}
} // namespace NEO

View File

@@ -15,6 +15,7 @@ enum class SipKernelType : std::uint32_t {
Csr = 0,
DbgCsr,
DbgCsrLocal,
DbgBindless,
COUNT
};