mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add initial support for context debug
Related-To: NEO-5478 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
eb1ea19360
commit
3ab932b101
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
* Copyright (C) 2017-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -468,3 +468,36 @@ TEST(DrmTest, givenNoPerContextVmsDrmWhenCreatingOsContextsThenVmIdIsNotQueriedA
|
||||
auto &drmVmIds = osContext.getDrmVmIds();
|
||||
EXPECT_EQ(0u, drmVmIds.size());
|
||||
}
|
||||
|
||||
TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextThenSetContextDebugFlagIsCalled) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingEnabled();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
|
||||
executionEnvironment->calculateMaxOsContextCount();
|
||||
executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
|
||||
|
||||
DrmMockNonFailing drmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
drmMock.contextDebugSupported = true;
|
||||
|
||||
OsContextLinux osContext(drmMock, 5u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, false, false);
|
||||
|
||||
// drmMock returns ctxId == 0
|
||||
EXPECT_EQ(0u, drmMock.passedContextDebugId);
|
||||
}
|
||||
|
||||
TEST(DrmTest, givenProgramDebuggingAndContextDebugAvailableWhenCreatingContextForInternalEngineThenSetContextDebugFlagIsNotCalled) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingEnabled();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
|
||||
executionEnvironment->calculateMaxOsContextCount();
|
||||
executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
|
||||
|
||||
DrmMockNonFailing drmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
drmMock.contextDebugSupported = true;
|
||||
|
||||
OsContextLinux osContext(drmMock, 5u, 1, aub_stream::ENGINE_RCS, PreemptionMode::Disabled, false, true, false);
|
||||
|
||||
EXPECT_EQ(static_cast<uint32_t>(-1), drmMock.passedContextDebugId);
|
||||
}
|
||||
|
Reference in New Issue
Block a user