mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
feature: Add sync host event handling on windows
Resolves: NEO-13744 Signed-off-by: Jemale Lockett <jemale.lockett@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fa1e3fd6a2
commit
8b508fd15f
@@ -351,7 +351,7 @@ struct MockDebugSession : public L0::DebugSessionImp {
|
||||
return DebugSessionImp::readThreadScratchRegisters(thread, start, count, pRegisterValues);
|
||||
}
|
||||
|
||||
void updateStoppedThreadsAndCheckTriggerEvents(const AttentionEventFields &attention, uint32_t tileIndex, std::vector<EuThread::ThreadId> &threadsWithAttention) override {}
|
||||
ze_result_t updateStoppedThreadsAndCheckTriggerEvents(const AttentionEventFields &attention, uint32_t tileIndex, std::vector<EuThread::ThreadId> &threadsWithAttention) override { return ZE_RESULT_SUCCESS; }
|
||||
void resumeAccidentallyStoppedThreads(const std::vector<EuThread::ThreadId> &threadIds) override {
|
||||
resumeAccidentallyStoppedCalled++;
|
||||
return DebugSessionImp::resumeAccidentallyStoppedThreads(threadIds);
|
||||
|
||||
@@ -33,6 +33,7 @@ struct MockDebugSessionWindows : DebugSessionWindows {
|
||||
using DebugSessionWindows::allModules;
|
||||
using DebugSessionWindows::allThreads;
|
||||
using DebugSessionWindows::asyncThread;
|
||||
using DebugSessionWindows::attentionEventContext;
|
||||
using DebugSessionWindows::calculateThreadSlotOffset;
|
||||
using DebugSessionWindows::closeAsyncThread;
|
||||
using DebugSessionWindows::debugArea;
|
||||
@@ -2021,5 +2022,43 @@ TEST_F(DebugApiWindowsTest, GivenResumeImpCalledThenBitmaskIsCorrect) {
|
||||
EXPECT_EQ(0u, bitmask[4]);
|
||||
}
|
||||
|
||||
TEST_F(DebugApiWindowsTest, givenSyncHostEventReceivedThenEventIsHandledAndAttentionEventContextUpdated) {
|
||||
zet_debug_config_t config = {};
|
||||
config.pid = 0x1234;
|
||||
|
||||
auto session = std::make_unique<MockDebugSessionWindows>(config, device);
|
||||
session->wddm = mockWddm;
|
||||
|
||||
session->allContexts = {};
|
||||
session->allContexts.insert(0x01);
|
||||
auto &l0GfxCoreHelper = neoDevice->getRootDeviceEnvironment().getHelper<L0GfxCoreHelper>();
|
||||
if (l0GfxCoreHelper.threadResumeRequiresUnlock()) {
|
||||
mockWddm->numEvents = 1;
|
||||
mockWddm->eventQueue[0].readEventType = DBGUMD_READ_EVENT_SYNC_HOST;
|
||||
mockWddm->eventQueue[0].eventParamsBuffer.eventParamsBuffer.SyncHostDataParams.hContextHandle = 0x12345;
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, session->readAndHandleEvent(100));
|
||||
EXPECT_EQ(1u, session->attentionEventContext.size());
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(DebugApiWindowsTest, givenErrorCasesWhenHandlingSyncHostThenErrorIsReturned) {
|
||||
zet_debug_config_t config = {};
|
||||
config.pid = 0x1234;
|
||||
|
||||
auto session = std::make_unique<MockDebugSessionWindows>(config, device);
|
||||
session->wddm = mockWddm;
|
||||
|
||||
session->allContexts = {};
|
||||
|
||||
auto &l0GfxCoreHelper = neoDevice->getRootDeviceEnvironment().getHelper<L0GfxCoreHelper>();
|
||||
if (l0GfxCoreHelper.threadResumeRequiresUnlock()) {
|
||||
mockWddm->numEvents = 1;
|
||||
mockWddm->eventQueue[0].readEventType = DBGUMD_READ_EVENT_SYNC_HOST;
|
||||
mockWddm->eventQueue[0].eventParamsBuffer.eventParamsBuffer.SyncHostDataParams.hContextHandle = 0x12345;
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_UNINITIALIZED, session->readAndHandleEvent(100));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
||||
|
||||
Reference in New Issue
Block a user