fix: add SLM support for tile attach

Resolves: NEO-7650

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2023-01-20 15:13:50 +00:00
committed by Compute-Runtime-Automation
parent adb3e126b4
commit f30e66d950
3 changed files with 28 additions and 0 deletions

View File

@@ -1951,6 +1951,7 @@ void TileDebugSessionLinux::readStateSaveAreaHeader() {
if (header) {
auto headerSize = rootDebugSession->stateSaveAreaHeader.size();
this->stateSaveAreaHeader.assign(reinterpret_cast<const char *>(header), reinterpret_cast<const char *>(header) + headerSize);
this->sipSupportsSlm = rootDebugSession->sipSupportsSlm;
}
};

View File

@@ -489,6 +489,7 @@ struct MockTileDebugSessionLinux : TileDebugSessionLinux {
using DebugSessionImp::newlyStoppedThreads;
using DebugSessionImp::resumeImp;
using DebugSessionImp::sendInterrupts;
using DebugSessionImp::sipSupportsSlm;
using DebugSessionImp::stateSaveAreaHeader;
using DebugSessionImp::triggerEvents;
using DebugSessionLinux::detached;

View File

@@ -117,6 +117,32 @@ TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenReadingContextStateSave
EXPECT_STREQ(header, data);
}
TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenReadingContextStateSaveAreaHeaderThenSlmSupportIsSetFromRootSession) {
auto hwInfo = *NEO::defaultHwInfo.get();
NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, 0));
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface);
Mock<L0::DeviceImp> deviceImp(neoDevice, neoDevice->getExecutionEnvironment());
auto rootSession = std::make_unique<MockDebugSessionLinux>(zet_debug_config_t{0x1234}, &deviceImp, 10);
rootSession->clientHandle = MockDebugSessionLinux::mockClientHandle;
auto session = std::make_unique<MockTileDebugSessionLinux>(zet_debug_config_t{0x1234}, &deviceImp, rootSession.get());
ASSERT_NE(nullptr, session);
const char *header = "cssa";
rootSession->stateSaveAreaHeader.assign(header, header + sizeof(header));
rootSession->sipSupportsSlm = false;
session->readStateSaveAreaHeader();
EXPECT_FALSE(session->stateSaveAreaHeader.empty());
EXPECT_FALSE(session->sipSupportsSlm);
rootSession->sipSupportsSlm = true;
session->readStateSaveAreaHeader();
EXPECT_FALSE(session->stateSaveAreaHeader.empty());
EXPECT_TRUE(session->sipSupportsSlm);
}
template <bool BlockOnFence = false>
struct TileAttachFixture : public DebugApiLinuxMultiDeviceFixture, public MockDebugSessionLinuxHelper {
void setUp() {