mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Revert "Remove default support for DCD"
This reverts commit a3e923e359.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
da6cb648b1
commit
ca51e557a2
@@ -15,10 +15,6 @@ using namespace NEO;
|
||||
|
||||
using EhlTest = Test<DeviceFixture>;
|
||||
|
||||
EHLTEST_F(EhlTest, givenEhlThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
EHLTEST_F(EhlTest, givenEhlWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
||||
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
|
||||
}
|
||||
|
||||
@@ -16,10 +16,6 @@ using namespace NEO;
|
||||
|
||||
using IcllpTest = Test<ClDeviceFixture>;
|
||||
|
||||
ICLLPTEST_F(IcllpTest, givenIcllpThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
ICLLPTEST_F(IcllpTest, givenIcllpWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
||||
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
|
||||
}
|
||||
|
||||
@@ -16,10 +16,6 @@ using namespace NEO;
|
||||
|
||||
using LkfTest = Test<ClDeviceFixture>;
|
||||
|
||||
LKFTEST_F(LkfTest, givenLkfThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
LKFTEST_F(LkfTest, givenLkfWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
||||
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
|
||||
}
|
||||
|
||||
@@ -17,10 +17,6 @@ using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> BxtDeviceCaps;
|
||||
|
||||
BXTTEST_F(BxtDeviceCaps, GivenBxtThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
BXTTEST_F(BxtDeviceCaps, WhenCheckingProfilingTimerResolutionThenCorrectResolutionIsReturned) {
|
||||
const auto &caps = pDevice->getDeviceInfo();
|
||||
EXPECT_EQ(52u, caps.outProfilingTimerResolution);
|
||||
|
||||
@@ -16,10 +16,6 @@ using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> BxtDeviceCapsWindows;
|
||||
|
||||
BXTTEST_F(BxtDeviceCapsWindows, GivenBxtWindowsThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
BXTTEST_F(BxtDeviceCapsWindows, GivenWhenGettingKmdNotifyPropertiesThenItIsDisabled) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
|
||||
@@ -16,10 +16,6 @@ using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> CflDeviceCaps;
|
||||
|
||||
CFLTEST_F(CflDeviceCaps, GivenCFLThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
CFLTEST_F(CflDeviceCaps, GivenCFLWhenCheckftr64KBpagesThenTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
|
||||
}
|
||||
|
||||
@@ -16,10 +16,6 @@ using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> CflDeviceCapsWindows;
|
||||
|
||||
CFLTEST_F(CflDeviceCapsWindows, GivenCflWindowsThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
CFLTEST_F(CflDeviceCapsWindows, GivenWhenGettingKmdNotifyPropertiesThenItIsDisabled) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
|
||||
@@ -16,10 +16,6 @@ using namespace NEO;
|
||||
|
||||
using GlkDeviceCaps = Test<DeviceFixture>;
|
||||
|
||||
GLKTEST_F(GlkDeviceCaps, givenGlkThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
GLKTEST_F(GlkDeviceCaps, WhenCheckingProfilingTimerResolutionThenCorrectResolutionIsReturned) {
|
||||
const auto &caps = pDevice->getDeviceInfo();
|
||||
EXPECT_EQ(52u, caps.outProfilingTimerResolution);
|
||||
|
||||
@@ -16,10 +16,6 @@ using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> GlkDeviceCapsWindows;
|
||||
|
||||
GLKTEST_F(GlkDeviceCapsWindows, GivenGlkWindowsThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
GLKTEST_F(GlkDeviceCapsWindows, WhenCheckingKmdNotifyPropertiesThenKmdNotifyIsEnabledCorrectly) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(30000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
|
||||
@@ -14,10 +14,6 @@ using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> KblDeviceCaps;
|
||||
|
||||
KBLTEST_F(KblDeviceCaps, GivenKBLThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
KBLTEST_F(KblDeviceCaps, GivenKBLWhenCheckftr64KBpagesThenTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
|
||||
}
|
||||
|
||||
@@ -14,10 +14,6 @@ using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> KblDeviceCapsWindows;
|
||||
|
||||
KBLTEST_F(KblDeviceCapsWindows, givenKblWindowsThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
KBLTEST_F(KblDeviceCapsWindows, GivenWhenGettingKmdNotifyPropertiesThenItIsDisabled) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
|
||||
@@ -17,10 +17,6 @@ using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> SklDeviceCaps;
|
||||
|
||||
SKLTEST_F(SklDeviceCaps, givenSklThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
SKLTEST_F(SklDeviceCaps, WhenCheckingProfilingTimerResolutionThenCorrectResolutionIsReturned) {
|
||||
const auto &caps = pDevice->getDeviceInfo();
|
||||
EXPECT_EQ(83u, caps.outProfilingTimerResolution);
|
||||
|
||||
@@ -16,10 +16,6 @@ using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> SklDeviceCapsWindows;
|
||||
|
||||
SKLTEST_F(SklDeviceCapsWindows, GivenSklWindowsThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
SKLTEST_F(SklDeviceCapsWindows, GivenWhenGettingKmdNotifyPropertiesThenItIsDisabled) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
|
||||
@@ -165,20 +165,6 @@ MockUnrestrictiveContext::MockUnrestrictiveContext() : MockContext(nullptr, null
|
||||
initializeWithDevices(ClDeviceVector{deviceIds, 3}, true);
|
||||
}
|
||||
|
||||
MockUnrestrictiveDebuggingSupportedContext::MockUnrestrictiveDebuggingSupportedContext() : MockContext(nullptr, nullptr) {
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
hwInfo.capabilityTable.debuggerSupported = true;
|
||||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u);
|
||||
|
||||
ultClDeviceFactory = std::make_unique<UltClDeviceFactory>(1, 2, static_cast<ClExecutionEnvironment *>(executionEnvironment));
|
||||
|
||||
pRootDevice = ultClDeviceFactory->rootDevices[0];
|
||||
pSubDevice0 = ultClDeviceFactory->subDevices[0];
|
||||
pSubDevice1 = ultClDeviceFactory->subDevices[1];
|
||||
cl_device_id deviceIds[] = {pRootDevice, pSubDevice0, pSubDevice1};
|
||||
initializeWithDevices(ClDeviceVector{deviceIds, 3}, true);
|
||||
}
|
||||
|
||||
MockUnrestrictiveContextMultiGPU::MockUnrestrictiveContextMultiGPU() : MockContext(nullptr, nullptr) {
|
||||
pRootDevice0 = ultClDeviceFactory.rootDevices[0];
|
||||
pSubDevice00 = ultClDeviceFactory.subDevices[0];
|
||||
|
||||
@@ -92,15 +92,6 @@ struct MockUnrestrictiveContext : MockContext {
|
||||
ClDevice *pSubDevice1 = nullptr;
|
||||
};
|
||||
|
||||
struct MockUnrestrictiveDebuggingSupportedContext : MockContext {
|
||||
MockUnrestrictiveDebuggingSupportedContext();
|
||||
|
||||
std::unique_ptr<UltClDeviceFactory> ultClDeviceFactory;
|
||||
MockClDevice *pRootDevice;
|
||||
ClDevice *pSubDevice0 = nullptr;
|
||||
ClDevice *pSubDevice1 = nullptr;
|
||||
};
|
||||
|
||||
struct MockUnrestrictiveContextMultiGPU : MockContext {
|
||||
MockUnrestrictiveContextMultiGPU();
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "shared/test/common/mocks/mock_csr.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "opencl/source/platform/platform.h"
|
||||
@@ -726,9 +725,7 @@ TEST(ProgramStringSectionTest, WhenConstStringBufferIsPresentThenUseItForLinking
|
||||
program.getKernelInfoArray(rootDeviceIndex).clear();
|
||||
}
|
||||
|
||||
using ProgramImplicitArgsTest = ::testing::Test;
|
||||
|
||||
TEST_F(ProgramImplicitArgsTest, givenImplicitRelocationAndStackCallsThenKernelRequiresImplicitArgs) {
|
||||
TEST(ProgramImplicitArgsTest, givenImplicitRelocationAndStackCallsThenKernelRequiresImplicitArgs) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
auto rootDeviceIndex = device->getRootDeviceIndex();
|
||||
MockProgram program{nullptr, false, toClDeviceVector(*device)};
|
||||
@@ -753,14 +750,13 @@ TEST_F(ProgramImplicitArgsTest, givenImplicitRelocationAndStackCallsThenKernelRe
|
||||
program.getKernelInfoArray(rootDeviceIndex).clear();
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramImplicitArgsTest, givenImplicitRelocationAndEnabledDebuggerThenKernelRequiresImplicitArgs, HasSourceLevelDebuggerSupport) {
|
||||
TEST(ProgramImplicitArgsTest, givenImplicitRelocationAndEnabledDebuggerThenKernelRequiresImplicitArgs) {
|
||||
if (!defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableMockSourceLevelDebugger.set(1);
|
||||
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
hwInfo.capabilityTable.debuggerSupported = true;
|
||||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u);
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithExecutionEnvironment<MockDevice>(&hwInfo, executionEnvironment, 0u));
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
|
||||
EXPECT_NE(nullptr, device->getDebugger());
|
||||
auto rootDeviceIndex = device->getRootDeviceIndex();
|
||||
@@ -786,7 +782,7 @@ HWTEST2_F(ProgramImplicitArgsTest, givenImplicitRelocationAndEnabledDebuggerThen
|
||||
program.getKernelInfoArray(rootDeviceIndex).clear();
|
||||
}
|
||||
|
||||
TEST_F(ProgramImplicitArgsTest, givenImplicitRelocationAndNoStackCallsAndDisabledDebuggerThenKernelDoesntRequireImplicitArgs) {
|
||||
TEST(ProgramImplicitArgsTest, givenImplicitRelocationAndNoStackCallsAndDisabledDebuggerThenKernelDoesntRequireImplicitArgs) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
EXPECT_EQ(nullptr, device->getDebugger());
|
||||
auto rootDeviceIndex = device->getRootDeviceIndex();
|
||||
|
||||
@@ -93,6 +93,10 @@ class ProgramWithKernelDebuggingFixture {
|
||||
void setUp() {
|
||||
pDevice = static_cast<MockDevice *>(&mockContext.getDevice(0)->getDevice());
|
||||
|
||||
if (!pDevice->getHardwareInfo().capabilityTable.debuggerSupported) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
std::string filename;
|
||||
std::string kernelOption(CompilerOptions::debugKernelEnable);
|
||||
KernelFilenameHelper::getKernelFilenameFromInternalOption(kernelOption, filename);
|
||||
@@ -102,21 +106,21 @@ class ProgramWithKernelDebuggingFixture {
|
||||
|
||||
void tearDown() {}
|
||||
|
||||
MockUnrestrictiveDebuggingSupportedContext mockContext;
|
||||
MockUnrestrictiveContext mockContext;
|
||||
std::unique_ptr<MockDebugProgram> program = nullptr;
|
||||
MockDevice *pDevice = nullptr;
|
||||
};
|
||||
|
||||
using ProgramWithKernelDebuggingTest = Test<ProgramWithKernelDebuggingFixture>;
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCompiledThenInternalOptionsIncludeDebugFlag, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCompiledThenInternalOptionsIncludeDebugFlag) {
|
||||
cl_int retVal = program->compile(program->getDevices(), nullptr,
|
||||
0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_TRUE(CompilerOptions::contains(program->compilerInterface->buildInternalOptions, CompilerOptions::debugKernelEnable));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCompiledThenInternalOptionsIncludeDashGFlag, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCompiledThenInternalOptionsIncludeDashGFlag) {
|
||||
cl_int retVal = program->compile(program->getDevices(), nullptr,
|
||||
0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -124,7 +128,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCo
|
||||
EXPECT_TRUE(hasSubstr(program->getOptions(), "-g"));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugAndOptDisabledWhenProgramIsCompiledThenOptionsIncludeClOptDisableFlag, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugAndOptDisabledWhenProgramIsCompiledThenOptionsIncludeClOptDisableFlag) {
|
||||
MockActiveSourceLevelDebugger *sourceLevelDebugger = new MockActiveSourceLevelDebugger;
|
||||
sourceLevelDebugger->isOptDisabled = true;
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->debugger.reset(sourceLevelDebugger);
|
||||
@@ -135,7 +139,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugAndOptDisabledW
|
||||
EXPECT_TRUE(hasSubstr(program->getOptions(), CompilerOptions::optDisable.data()));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, GivenDebugVarDebuggerOptDisableZeroWhenOptDisableIsTrueFromDebuggerThenOptDisableIsNotAdded, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, GivenDebugVarDebuggerOptDisableZeroWhenOptDisableIsTrueFromDebuggerThenOptDisableIsNotAdded) {
|
||||
DebugManagerStateRestore dgbRestorer;
|
||||
NEO::DebugManager.flags.DebuggerOptDisable.set(0);
|
||||
|
||||
@@ -149,7 +153,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, GivenDebugVarDebuggerOptDisableZeroWhe
|
||||
EXPECT_FALSE(hasSubstr(program->getOptions(), CompilerOptions::optDisable.data()));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, GivenDebugVarDebuggerOptDisableOneWhenOptDisableIsFalseFromDebuggerThenOptDisableIsAdded, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, GivenDebugVarDebuggerOptDisableOneWhenOptDisableIsFalseFromDebuggerThenOptDisableIsAdded) {
|
||||
DebugManagerStateRestore dgbRestorer;
|
||||
NEO::DebugManager.flags.DebuggerOptDisable.set(1);
|
||||
|
||||
@@ -163,7 +167,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, GivenDebugVarDebuggerOptDisableOneWhen
|
||||
EXPECT_TRUE(hasSubstr(program->getOptions(), CompilerOptions::optDisable.data()));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCompiledThenOptionsStartsWithDashSFilename, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCompiledThenOptionsStartsWithDashSFilename) {
|
||||
MockActiveSourceLevelDebugger *sourceLevelDebugger = new MockActiveSourceLevelDebugger;
|
||||
sourceLevelDebugger->sourceCodeFilename = "debugFileName";
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->debugger.reset(sourceLevelDebugger);
|
||||
@@ -174,7 +178,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCo
|
||||
EXPECT_TRUE(startsWith(program->getOptions(), "-s \"debugFileName\""));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCompiledWithCmCOptionThenDashSFilenameIsNotPrepended, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCompiledWithCmCOptionThenDashSFilenameIsNotPrepended) {
|
||||
MockActiveSourceLevelDebugger *sourceLevelDebugger = new MockActiveSourceLevelDebugger;
|
||||
sourceLevelDebugger->sourceCodeFilename = "debugFileName";
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->debugger.reset(sourceLevelDebugger);
|
||||
@@ -187,19 +191,19 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCo
|
||||
EXPECT_TRUE(hasSubstr(program->getOptions(), CompilerOptions::optDisable.data()));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltThenInternalOptionsIncludeDebugFlag, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltThenInternalOptionsIncludeDebugFlag) {
|
||||
cl_int retVal = program->build(program->getDevices(), nullptr, false);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_TRUE(CompilerOptions::contains(program->compilerInterface->buildInternalOptions, CompilerOptions::debugKernelEnable));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltThenOptionsIncludeDashGFlag, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltThenOptionsIncludeDashGFlag) {
|
||||
cl_int retVal = program->build(program->getDevices(), nullptr, false);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_TRUE(hasSubstr(program->getOptions(), "-g"));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugAndOptDisabledWhenProgramIsBuiltThenOptionsIncludeClOptDisableFlag, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugAndOptDisabledWhenProgramIsBuiltThenOptionsIncludeClOptDisableFlag) {
|
||||
MockActiveSourceLevelDebugger *sourceLevelDebugger = new MockActiveSourceLevelDebugger;
|
||||
sourceLevelDebugger->isOptDisabled = true;
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->debugger.reset(sourceLevelDebugger);
|
||||
@@ -209,7 +213,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugAndOptDisabledW
|
||||
EXPECT_TRUE(hasSubstr(program->getOptions(), CompilerOptions::optDisable.data()));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltThenOptionsStartsWithDashSFilename, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltThenOptionsStartsWithDashSFilename) {
|
||||
MockActiveSourceLevelDebugger *sourceLevelDebugger = new MockActiveSourceLevelDebugger;
|
||||
sourceLevelDebugger->sourceCodeFilename = "debugFileName";
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->debugger.reset(sourceLevelDebugger);
|
||||
@@ -219,7 +223,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBu
|
||||
EXPECT_TRUE(startsWith(program->getOptions(), "-s \"debugFileName\""));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltWithCmCOptionThenDashSFilenameIsNotPrepended, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltWithCmCOptionThenDashSFilenameIsNotPrepended) {
|
||||
MockActiveSourceLevelDebugger *sourceLevelDebugger = new MockActiveSourceLevelDebugger;
|
||||
sourceLevelDebugger->sourceCodeFilename = "debugFileName";
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->debugger.reset(sourceLevelDebugger);
|
||||
@@ -230,7 +234,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBu
|
||||
EXPECT_FALSE(startsWith(program->getOptions(), "-s debugFileName"));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsLinkedThenKernelDebugOptionsAreAppended, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsLinkedThenKernelDebugOptionsAreAppended) {
|
||||
MockActiveSourceLevelDebugger *sourceLevelDebugger = new MockActiveSourceLevelDebugger;
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->debugger.reset(sourceLevelDebugger);
|
||||
|
||||
@@ -249,7 +253,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsLi
|
||||
EXPECT_EQ(static_cast<unsigned int>(mockContext.getRootDeviceIndices().size()), newProgram->appendKernelDebugOptionsCalled);
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltThenDebuggerIsNotifiedWithKernelDebugData, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltThenDebuggerIsNotifiedWithKernelDebugData) {
|
||||
const size_t rootDeviceIndicesSize = mockContext.getRootDeviceIndices().size();
|
||||
std::vector<MockSourceLevelDebugger *> sourceLevelDebugger(rootDeviceIndicesSize, nullptr);
|
||||
size_t i = 0;
|
||||
@@ -275,7 +279,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBu
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsLinkedThenDebuggerIsNotifiedWithKernelDebugData, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsLinkedThenDebuggerIsNotifiedWithKernelDebugData) {
|
||||
const size_t rootDeviceIndicesSize = mockContext.getRootDeviceIndices().size();
|
||||
std::vector<MockSourceLevelDebugger *> sourceLevelDebugger(rootDeviceIndicesSize, nullptr);
|
||||
size_t i = 0;
|
||||
@@ -307,7 +311,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsLi
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenGtpinInitializedWhenCreatingProgramFromBinaryThenDebugDataIsAvailable, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenGtpinInitializedWhenCreatingProgramFromBinaryThenDebugDataIsAvailable) {
|
||||
bool gtpinInitializedBackup = NEO::isGTPinInitialized;
|
||||
NEO::isGTPinInitialized = true;
|
||||
auto retVal = program->build(program->getDevices(), CompilerOptions::debugKernelEnable.data(), false);
|
||||
@@ -318,7 +322,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenGtpinInitializedWhenCreatingProgr
|
||||
NEO::isGTPinInitialized = gtpinInitializedBackup;
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenGtpinNotInitializedWhenCreatingProgramFromBinaryThenDebugDataINullptr, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenGtpinNotInitializedWhenCreatingProgramFromBinaryThenDebugDataINullptr) {
|
||||
bool gtpinInitializedBackup = NEO::isGTPinInitialized;
|
||||
NEO::isGTPinInitialized = false;
|
||||
program->kernelDebugEnabled = false;
|
||||
@@ -330,7 +334,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenGtpinNotInitializedWhenCreatingPr
|
||||
NEO::isGTPinInitialized = gtpinInitializedBackup;
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenKernelDebugEnabledWhenProgramIsBuiltThenDebugDataIsStored, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenKernelDebugEnabledWhenProgramIsBuiltThenDebugDataIsStored) {
|
||||
auto retVal = program->build(program->getDevices(), nullptr, false);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
@@ -339,7 +343,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenKernelDebugEnabledWhenProgramIsBu
|
||||
EXPECT_NE(0u, program->getDebugDataSize(pDevice->getRootDeviceIndex()));
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenProgramWithKernelDebugEnabledWhenProcessDebugDataIsCalledThenKernelInfosAreFilledWithDebugData, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenProgramWithKernelDebugEnabledWhenProcessDebugDataIsCalledThenKernelInfosAreFilledWithDebugData) {
|
||||
iOpenCL::SProgramDebugDataHeaderIGC debugDataHeader{};
|
||||
debugDataHeader.NumberOfKernels = 1u;
|
||||
|
||||
@@ -377,7 +381,7 @@ HWTEST2_F(ProgramWithKernelDebuggingTest, givenProgramWithKernelDebugEnabledWhen
|
||||
EXPECT_NE(nullptr, receivedKernelInfo->debugData.vIsa);
|
||||
}
|
||||
|
||||
HWTEST2_F(ProgramWithKernelDebuggingTest, givenProgramWithNonZebinaryFormatAndKernelDebugEnabledWhenProgramIsBuiltThenProcessDebugDataIsCalledAndDebuggerNotified, HasSourceLevelDebuggerSupport) {
|
||||
TEST_F(ProgramWithKernelDebuggingTest, givenProgramWithNonZebinaryFormatAndKernelDebugEnabledWhenProgramIsBuiltThenProcessDebugDataIsCalledAndDebuggerNotified) {
|
||||
MockSourceLevelDebugger *sourceLevelDebugger = new MockSourceLevelDebugger;
|
||||
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->debugger.reset(sourceLevelDebugger);
|
||||
program->enableKernelDebug();
|
||||
|
||||
@@ -32,15 +32,6 @@ using namespace NEO;
|
||||
using std::string;
|
||||
using std::unique_ptr;
|
||||
|
||||
class SourceLevelDebuggerSupportedFixture : public ::testing::Test {
|
||||
public:
|
||||
void SetUp() override {
|
||||
hwInfo.capabilityTable.debuggerSupported = true;
|
||||
}
|
||||
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
};
|
||||
|
||||
class DebuggerLibraryRestorer {
|
||||
public:
|
||||
DebuggerLibraryRestorer() {
|
||||
@@ -64,47 +55,54 @@ TEST(SourceLevelDebugger, whenSourceLevelDebuggerIsCreatedThenLegacyModeIsTrue)
|
||||
EXPECT_TRUE(debugger.isLegacy());
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenPlatformWhenItIsCreatedThenSourceLevelDebuggerIsCreatedInExecutionEnvironment, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenPlatformWhenItIsCreatedThenSourceLevelDebuggerIsCreatedInExecutionEnvironment) {
|
||||
DebuggerLibraryRestorer restorer;
|
||||
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u);
|
||||
MockPlatform platform(*executionEnvironment);
|
||||
platform.initializeWithNewDevices();
|
||||
if (defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
auto executionEnvironment = new ExecutionEnvironment();
|
||||
MockPlatform platform(*executionEnvironment);
|
||||
platform.initializeWithNewDevices();
|
||||
|
||||
EXPECT_NE(nullptr, executionEnvironment->rootDeviceEnvironments[0]->debugger);
|
||||
EXPECT_NE(nullptr, executionEnvironment->rootDeviceEnvironments[0]->debugger);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenPlatformWhenSourceLevelDebuggerIsCreatedThenRuntimeCapabilityHasFusedEusDisabled, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenPlatformWhenSourceLevelDebuggerIsCreatedThenRuntimeCapabilityHasFusedEusDisabled) {
|
||||
DebuggerLibraryRestorer restorer;
|
||||
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u);
|
||||
MockPlatform platform(*executionEnvironment);
|
||||
platform.initializeWithNewDevices();
|
||||
if (defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
auto executionEnvironment = new ExecutionEnvironment();
|
||||
MockPlatform platform(*executionEnvironment);
|
||||
platform.initializeWithNewDevices();
|
||||
|
||||
ASSERT_NE(nullptr, executionEnvironment->rootDeviceEnvironments[0]->debugger);
|
||||
EXPECT_FALSE(executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.fusedEuEnabled);
|
||||
ASSERT_NE(nullptr, executionEnvironment->rootDeviceEnvironments[0]->debugger);
|
||||
|
||||
EXPECT_FALSE(executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.fusedEuEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenPlatformWhenInitializingSourceLevelDebuggerFailsThenRuntimeCapabilityFusedEusAreNotModified, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenPlatformWhenInitializingSourceLevelDebuggerFailsThenRuntimeCapabilityFusedEusAreNotModified) {
|
||||
DebuggerLibraryRestorer restorer;
|
||||
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
interceptor.initRetVal = -1;
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u);
|
||||
MockPlatform platform(*executionEnvironment);
|
||||
platform.initializeWithNewDevices();
|
||||
if (defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
interceptor.initRetVal = -1;
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
auto executionEnvironment = new ExecutionEnvironment();
|
||||
MockPlatform platform(*executionEnvironment);
|
||||
platform.initializeWithNewDevices();
|
||||
|
||||
bool defaultValue = hwInfo.capabilityTable.fusedEuEnabled;
|
||||
bool defaultValue = defaultHwInfo->capabilityTable.fusedEuEnabled;
|
||||
|
||||
ASSERT_NE(nullptr, executionEnvironment->rootDeviceEnvironments[0]->debugger);
|
||||
EXPECT_EQ(defaultValue, executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.fusedEuEnabled);
|
||||
ASSERT_NE(nullptr, executionEnvironment->rootDeviceEnvironments[0]->debugger);
|
||||
EXPECT_EQ(defaultValue, executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.fusedEuEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(SourceLevelDebugger, givenNoKernelDebuggerLibraryWhenSourceLevelDebuggerIsCreatedThenLibraryIsNotLoaded) {
|
||||
@@ -550,63 +548,65 @@ TEST(SourceLevelDebugger, givenKernelDebuggerLibraryNotActiveWhenInitializeIsCal
|
||||
EXPECT_FALSE(interceptor.initCalled);
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenKernelDebuggerLibraryActiveWhenDeviceIsConstructedThenDebuggerIsInitialized, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenKernelDebuggerLibraryActiveWhenDeviceIsConstructedThenDebuggerIsInitialized) {
|
||||
DebuggerLibraryRestorer restorer;
|
||||
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
if (defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
|
||||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u);
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithExecutionEnvironment<MockDevice>(&hwInfo, executionEnvironment, 0u));
|
||||
EXPECT_TRUE(interceptor.initCalled);
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
EXPECT_TRUE(interceptor.initCalled);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenKernelDebuggerLibraryActiveWhenDeviceImplIsCreatedThenDebuggerIsNotified, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenKernelDebuggerLibraryActiveWhenDeviceImplIsCreatedThenDebuggerIsNotified) {
|
||||
DebuggerLibraryRestorer restorer;
|
||||
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
if (defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
|
||||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u);
|
||||
unique_ptr<MockDevice> device(MockDevice::createWithExecutionEnvironment<MockDevice>(&hwInfo, executionEnvironment, 0u));
|
||||
unique_ptr<MockClDevice> pClDevice(new MockClDevice{device.get()});
|
||||
EXPECT_TRUE(interceptor.newDeviceCalled);
|
||||
uint32_t deviceHandleExpected = device->getGpgpuCommandStreamReceiver().getOSInterface() != nullptr ? device->getGpgpuCommandStreamReceiver().getOSInterface()->getDriverModel()->getDeviceHandle() : 0;
|
||||
EXPECT_EQ(reinterpret_cast<GfxDeviceHandle>(static_cast<uint64_t>(deviceHandleExpected)), interceptor.newDeviceArgIn.dh);
|
||||
pClDevice.reset();
|
||||
device.release();
|
||||
unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
unique_ptr<MockClDevice> pClDevice(new MockClDevice{device.get()});
|
||||
EXPECT_TRUE(interceptor.newDeviceCalled);
|
||||
uint32_t deviceHandleExpected = device->getGpgpuCommandStreamReceiver().getOSInterface() != nullptr ? device->getGpgpuCommandStreamReceiver().getOSInterface()->getDriverModel()->getDeviceHandle() : 0;
|
||||
EXPECT_EQ(reinterpret_cast<GfxDeviceHandle>(static_cast<uint64_t>(deviceHandleExpected)), interceptor.newDeviceArgIn.dh);
|
||||
pClDevice.reset();
|
||||
device.release();
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenKernelDebuggerLibraryActiveWhenDeviceImplIsCreatedWithOsCsrThenDebuggerIsNotifiedWithCorrectDeviceHandle, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenKernelDebuggerLibraryActiveWhenDeviceImplIsCreatedWithOsCsrThenDebuggerIsNotifiedWithCorrectDeviceHandle) {
|
||||
DebuggerLibraryRestorer restorer;
|
||||
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
if (defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
|
||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||
ultHwConfig.useHwCsr = true;
|
||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||
ultHwConfig.useHwCsr = true;
|
||||
|
||||
HardwareInfo *hwInfo = nullptr;
|
||||
ExecutionEnvironment *executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1);
|
||||
HardwareInfo *hwInfo = nullptr;
|
||||
ExecutionEnvironment *executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1);
|
||||
|
||||
hwInfo->capabilityTable.debuggerSupported = true;
|
||||
hwInfo->capabilityTable.instrumentationEnabled = true;
|
||||
hwInfo->capabilityTable.instrumentationEnabled = true;
|
||||
unique_ptr<MockDevice> device(Device::create<MockDevice>(executionEnvironment, 0));
|
||||
unique_ptr<MockClDevice> pClDevice(new MockClDevice{device.get()});
|
||||
|
||||
unique_ptr<MockDevice> device(Device::create<MockDevice>(executionEnvironment, 0));
|
||||
unique_ptr<MockClDevice> pClDevice(new MockClDevice{device.get()});
|
||||
ASSERT_NE(nullptr, device->getGpgpuCommandStreamReceiver().getOSInterface());
|
||||
|
||||
ASSERT_NE(nullptr, device->getGpgpuCommandStreamReceiver().getOSInterface());
|
||||
|
||||
EXPECT_TRUE(interceptor.newDeviceCalled);
|
||||
uint32_t deviceHandleExpected = device->getGpgpuCommandStreamReceiver().getOSInterface()->getDriverModel()->getDeviceHandle();
|
||||
EXPECT_EQ(reinterpret_cast<GfxDeviceHandle>(static_cast<uint64_t>(deviceHandleExpected)), interceptor.newDeviceArgIn.dh);
|
||||
device.release();
|
||||
EXPECT_TRUE(interceptor.newDeviceCalled);
|
||||
uint32_t deviceHandleExpected = device->getGpgpuCommandStreamReceiver().getOSInterface()->getDriverModel()->getDeviceHandle();
|
||||
EXPECT_EQ(reinterpret_cast<GfxDeviceHandle>(static_cast<uint64_t>(deviceHandleExpected)), interceptor.newDeviceArgIn.dh);
|
||||
device.release();
|
||||
}
|
||||
}
|
||||
|
||||
TEST(SourceLevelDebugger, givenKernelDebuggerLibraryNotActiveWhenDeviceIsCreatedThenDebuggerIsNotCreatedInitializedAndNotNotified) {
|
||||
@@ -624,19 +624,6 @@ TEST(SourceLevelDebugger, givenKernelDebuggerLibraryNotActiveWhenDeviceIsCreated
|
||||
EXPECT_FALSE(interceptor.newDeviceCalled);
|
||||
}
|
||||
|
||||
TEST(SourceLevelDebugger, givenDefaultStateWhenDeviceIsCreatedThenLoadDebuggerLibraryIsNotCalled) {
|
||||
DebuggerLibraryRestorer restorer;
|
||||
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(false);
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
|
||||
EXPECT_FALSE(interceptor.loadCalled);
|
||||
}
|
||||
|
||||
TEST(SourceLevelDebugger, givenKernelDebuggerLibraryNotActiveWhenGettingSourceLevelDebuggerThenNullptrIsReturned) {
|
||||
DebuggerLibraryRestorer restorer;
|
||||
|
||||
@@ -666,46 +653,50 @@ TEST(SourceLevelDebugger, givenDeviceWithDebuggerActiveSetWhenSourceLevelDebugge
|
||||
EXPECT_FALSE(interceptor.deviceDestructionCalled);
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenTwoRootDevicesWhenSecondIsCreatedThenCreatingNewSourceLevelDebugger, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenTwoRootDevicesWhenSecondIsCreatedThenCreatingNewSourceLevelDebugger) {
|
||||
DebuggerLibraryRestorer restorer;
|
||||
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
if (defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
DebuggerLibraryInterceptor interceptor;
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
|
||||
|
||||
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(2);
|
||||
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
|
||||
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(&hwInfo);
|
||||
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
|
||||
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(2);
|
||||
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
|
||||
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
|
||||
}
|
||||
auto device1 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
|
||||
EXPECT_NE(nullptr, executionEnvironment->memoryManager);
|
||||
EXPECT_TRUE(interceptor.initCalled);
|
||||
|
||||
interceptor.initCalled = false;
|
||||
auto device2 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
|
||||
EXPECT_NE(nullptr, executionEnvironment->memoryManager);
|
||||
EXPECT_TRUE(interceptor.initCalled);
|
||||
}
|
||||
auto device1 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
|
||||
EXPECT_NE(nullptr, executionEnvironment->memoryManager);
|
||||
EXPECT_TRUE(interceptor.initCalled);
|
||||
|
||||
interceptor.initCalled = false;
|
||||
auto device2 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
|
||||
EXPECT_NE(nullptr, executionEnvironment->memoryManager);
|
||||
EXPECT_TRUE(interceptor.initCalled);
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenMultipleRootDevicesWhenCreatedThenUseDedicatedSourceLevelDebugger, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenMultipleRootDevicesWhenCreatedThenUseDedicatedSourceLevelDebugger) {
|
||||
DebuggerLibraryRestorer restorer;
|
||||
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
if (defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
DebuggerLibrary::setLibraryAvailable(true);
|
||||
DebuggerLibrary::setDebuggerActive(true);
|
||||
|
||||
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(2);
|
||||
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
|
||||
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(&hwInfo);
|
||||
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
|
||||
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(2);
|
||||
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
|
||||
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
|
||||
}
|
||||
auto device1 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
|
||||
auto sourceLevelDebugger = device1->getDebugger();
|
||||
auto device2 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
|
||||
EXPECT_NE(sourceLevelDebugger, device2->getDebugger());
|
||||
}
|
||||
auto device1 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
|
||||
auto sourceLevelDebugger = device1->getDebugger();
|
||||
auto device2 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
|
||||
EXPECT_NE(sourceLevelDebugger, device2->getDebugger());
|
||||
}
|
||||
|
||||
TEST(SourceLevelDebugger, whenCaptureSBACalledThenNoCommandsAreAddedToStream) {
|
||||
@@ -727,13 +718,16 @@ TEST(SourceLevelDebugger, whenGetSbaTrackingCommandsSizeQueriedThenZeroIsReturne
|
||||
EXPECT_EQ(0u, size);
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenEnableMockSourceLevelDebuggerWhenInitializingExecEnvThenActiveDebuggerWithEmptyInterfaceIsCreated, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenEnableMockSourceLevelDebuggerWhenInitializingExecEnvThenActiveDebuggerWithEmptyInterfaceIsCreated) {
|
||||
if (!defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
GTEST_SKIP_("Source Level Debugger not supported");
|
||||
}
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebuggerLibraryRestorer restorer;
|
||||
DebuggerLibrary::setLibraryAvailable(false);
|
||||
|
||||
DebugManager.flags.EnableMockSourceLevelDebugger.set(1);
|
||||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u);
|
||||
auto executionEnvironment = new ExecutionEnvironment();
|
||||
MockPlatform platform(*executionEnvironment);
|
||||
platform.initializeWithNewDevices();
|
||||
|
||||
@@ -772,7 +766,10 @@ HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenEnableMockSourceLevelDebugge
|
||||
EXPECT_TRUE(debugger->notifyDeviceDestruction());
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenMode1InEnableMockSourceLevelDebuggerWhenDebuggerCreatedThenIsOptimizationDisabledReturnsTrue, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenMode1InEnableMockSourceLevelDebuggerWhenDebuggerCreatedThenIsOptimizationDisabledReturnsTrue) {
|
||||
if (!defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
GTEST_SKIP_("Source Level Debugger not supported");
|
||||
}
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebuggerLibraryRestorer restorer;
|
||||
DebuggerLibrary::setLibraryAvailable(false);
|
||||
@@ -783,7 +780,10 @@ HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenMode1InEnableMockSourceLevel
|
||||
EXPECT_TRUE(sld->isOptimizationDisabled());
|
||||
}
|
||||
|
||||
HWTEST2_F(SourceLevelDebuggerSupportedFixture, givenMode2InEnableMockSourceLevelDebuggerWhenDebuggerCreatedThenIsOptimizationDisabledReturnsFalse, HasSourceLevelDebuggerSupport) {
|
||||
TEST(SourceLevelDebugger, givenMode2InEnableMockSourceLevelDebuggerWhenDebuggerCreatedThenIsOptimizationDisabledReturnsFalse) {
|
||||
if (!defaultHwInfo->capabilityTable.debuggerSupported) {
|
||||
GTEST_SKIP_("Source Level Debugger not supported");
|
||||
}
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebuggerLibraryRestorer restorer;
|
||||
DebuggerLibrary::setLibraryAvailable(false);
|
||||
@@ -904,11 +904,7 @@ HWTEST2_F(LegacyDebuggerTest, givenNotXeHpOrXeHpgCoreAndDebugIsActiveThenDisable
|
||||
HWTEST2_F(LegacyDebuggerTest, givenXeHpOrXeHpgCoreAndDebugIsActiveThenDisableL3CacheInGmmHelperIsSet, IsXeHpOrXeHpgCore) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.EnableMockSourceLevelDebugger.set(1);
|
||||
|
||||
auto hwInfo = *NEO::defaultHwInfo;
|
||||
hwInfo.capabilityTable.debuggerSupported = true;
|
||||
auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u);
|
||||
|
||||
auto executionEnvironment = new ExecutionEnvironment();
|
||||
MockPlatform platform(*executionEnvironment);
|
||||
platform.initializeWithNewDevices();
|
||||
|
||||
|
||||
@@ -30,10 +30,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XE_HP_COREDeviceCaps, givenKernelThatDoesStatelessW
|
||||
EXPECT_EQ(statelessWritesEmitted, mockKernel.mockKernel->areStatelessWritesUsed());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenXE_HP_COREThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenXE_HP_COREWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
||||
}
|
||||
|
||||
@@ -16,10 +16,6 @@ using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> XeHPUsDeviceIdTest;
|
||||
|
||||
XEHPTEST_F(XeHPUsDeviceIdTest, givenXeHPThenDebuggerIsNotSupported) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.debuggerSupported);
|
||||
}
|
||||
|
||||
XEHPTEST_F(XeHPUsDeviceIdTest, WhenGettingHardwareInfoThenProductFamilyIsXeHpSdv) {
|
||||
EXPECT_EQ(IGFX_XE_HP_SDV, pDevice->getHardwareInfo().platform.eProductFamily);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user