Move clGfxCoreHelper ownership to rootDeviceEnv

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-01-03 10:27:35 +00:00
committed by Compute-Runtime-Automation
parent 5ff0ff0997
commit 468d722efb
127 changed files with 440 additions and 393 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -59,7 +59,7 @@ class AUBFixture : public CommandQueueHwFixture {
executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1u);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique<MockMemoryOperationsHandler>();

View File

@@ -99,7 +99,7 @@ void MulticontextAubFixture::setUp(uint32_t numberOfTiles, EnabledCommandStreame
ultHwConfig.useHwCsr = true;
constructPlatform()->peekExecutionEnvironment()->prepareRootDeviceEnvironments(1u);
platform()->peekExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex]->setHwInfo(&localHwInfo);
platform()->peekExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex]->setHwInfoAndInitHelpers(&localHwInfo);
platform()->peekExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex]->initGmm();
initPlatform();

View File

@@ -1475,28 +1475,32 @@ HWTEST_F(QueueFamilyNameTest, givenInvalidEngineGroupWhenGettingQueueFamilyNameT
verify(EngineGroupType::MaxEngineGroups, "");
}
HWTEST_F(QueueFamilyNameTest, givenTooBigQueueFamilyNameWhenGettingQueueFamilyNameThenExceptionIsThrown) {
struct MockClGfxCoreHelper : NEO::ClGfxCoreHelperHw<FamilyType> {
bool getQueueFamilyName(std::string &name, EngineGroupType type) const override {
name = familyNameOverride;
return true;
}
std::string familyNameOverride = "";
};
template <typename FamilyType>
struct MyMockClGfxCoreHelper : NEO::ClGfxCoreHelperHw<FamilyType> {
bool getQueueFamilyName(std::string &name, EngineGroupType type) const override {
name = familyNameOverride;
return true;
}
std::string familyNameOverride = "";
};
MockClGfxCoreHelper clGfxCoreHelper{};
VariableBackup<ClGfxCoreHelper *> clGfxCoreHelperFactoryBackup{
&NEO::clGfxCoreHelperFactory[static_cast<size_t>(defaultHwInfo->platform.eRenderCoreFamily)]};
clGfxCoreHelperFactoryBackup = &clGfxCoreHelper;
HWTEST_F(QueueFamilyNameTest, givenTooBigQueueFamilyNameWhenGettingQueueFamilyNameThenExceptionIsThrown) {
MyMockClGfxCoreHelper<FamilyType> mockClGfxCoreHelper{};
std::unique_ptr<ApiGfxCoreHelper> clGfxCoreHelper(static_cast<ApiGfxCoreHelper *>(&mockClGfxCoreHelper));
device->executionEnvironment->rootDeviceEnvironments[0]->apiGfxCoreHelper.swap(clGfxCoreHelper);
char name[CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL] = "";
clGfxCoreHelper.familyNameOverride = std::string(CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL - 1, 'a');
mockClGfxCoreHelper.familyNameOverride = std::string(CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL - 1, 'a');
device->getQueueFamilyName(name, EngineGroupType::MaxEngineGroups);
EXPECT_EQ(0, std::strcmp(name, clGfxCoreHelper.familyNameOverride.c_str()));
EXPECT_EQ(0, std::strcmp(name, mockClGfxCoreHelper.familyNameOverride.c_str()));
clGfxCoreHelper.familyNameOverride = std::string(CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL, 'a');
mockClGfxCoreHelper.familyNameOverride = std::string(CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL, 'a');
EXPECT_ANY_THROW(device->getQueueFamilyName(name, EngineGroupType::MaxEngineGroups));
device->executionEnvironment->rootDeviceEnvironments[0]->apiGfxCoreHelper.swap(clGfxCoreHelper);
clGfxCoreHelper.release();
}
using isPreGen12 = IsBeforeGfxCore<IGFX_GEN12_CORE>;

View File

@@ -290,7 +290,7 @@ TEST(DeviceCreation, givenMultiRootDeviceWhenTheyAreCreatedThenEachOsContextHasU
const size_t numDevices = 2;
executionEnvironment->prepareRootDeviceEnvironments(numDevices);
for (auto i = 0u; i < numDevices; i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
}
@@ -355,7 +355,7 @@ TEST(DeviceCreation, givenMultiRootDeviceWhenTheyAreCreatedThenEachDeviceHasSepe
const size_t numDevices = 2;
executionEnvironment->prepareRootDeviceEnvironments(numDevices);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
auto device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
@@ -370,7 +370,7 @@ TEST(DeviceCreation, givenMultiRootDeviceWhenTheyAreCreatedThenEachDeviceHasSepe
const size_t numDevices = 2;
executionEnvironment->prepareRootDeviceEnvironments(numDevices);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
}
@@ -513,7 +513,7 @@ HWTEST_F(DeviceHwTest, givenGfxCoreHelperInputWhenInitializingCsrThenCreatePageT
executionEnvironment.prepareRootDeviceEnvironments(3);
executionEnvironment.incRefInternal();
for (auto i = 0u; i < executionEnvironment.rootDeviceEnvironments.size(); i++) {
executionEnvironment.rootDeviceEnvironments[i]->setHwInfo(&localHwInfo);
executionEnvironment.rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(&localHwInfo);
executionEnvironment.rootDeviceEnvironments[i]->initGmm();
}
executionEnvironment.initializeMemoryManager();

View File

@@ -237,7 +237,7 @@ TEST(RootDevicesTest, givenRootDeviceWithoutSubdevicesWhenCreateEnginesThenDevic
hwInfo.capabilityTable.blitterOperationsSupported = true;
auto executionEnvironment = new MockExecutionEnvironment;
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
MockDevice device(executionEnvironment, 0);
auto &gfxCoreHelper = device.getGfxCoreHelper();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -1666,7 +1666,7 @@ HWTEST_F(EventTest, givenQuickKmdSleepRequestWhenWaitIsCalledThenPassRequestToWa
localHwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds = 1;
localHwInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds = 2;
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->setHwInfo(&localHwInfo);
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->setHwInfoAndInitHelpers(&localHwInfo);
auto csr = new TestEventCsr<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield());
pDevice->resetCommandStreamReceiver(csr);
@@ -1689,7 +1689,7 @@ HWTEST_F(EventTest, givenNonQuickKmdSleepRequestWhenWaitIsCalledThenPassRequestT
localHwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds = 1;
localHwInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds = 2;
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->setHwInfo(&localHwInfo);
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->setHwInfoAndInitHelpers(&localHwInfo);
auto csr = new TestEventCsr<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield());
pDevice->resetCommandStreamReceiver(csr);

View File

@@ -118,7 +118,7 @@ TEST(ExecutionEnvironment, givenDeviceWhenItIsDestroyedThenMemoryManagerIsStillA
TEST(RootDeviceEnvironment, givenExecutionEnvironmentWhenInitializeAubCenterIsCalledThenItIsReceivesCorrectInputParams) {
MockExecutionEnvironment executionEnvironment;
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
rootDeviceEnvironment->initAubCenter(true, "test.aub", CommandStreamReceiverType::CSR_AUB);
EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled);
@@ -322,7 +322,7 @@ TEST(ExecutionEnvironment, givenMultipleRootDevicesWhenTheyAreCreatedThenReuseMe
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
std::unique_ptr<MockDevice> device(Device::create<MockDevice>(executionEnvironment, 0u));

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -133,7 +133,7 @@ struct ImageClearColorFixture : ::testing::Test {
NEO::platformsImpl->clear();
NEO::constructPlatform()->peekExecutionEnvironment()->prepareRootDeviceEnvironments(1u);
NEO::platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]->setHwInfo(&hardwareInfo);
NEO::platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hardwareInfo);
NEO::platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]->initGmm();
}

View File

@@ -1145,7 +1145,7 @@ TEST(GmmHelperTest, givenGmmHelperAndForceAllResourcesUncachedDebugVariableSetTh
struct GmmCompressionTests : public MockExecutionEnvironmentGmmFixtureTest {
void SetUp() override {
MockExecutionEnvironmentGmmFixtureTest::SetUp();
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
localPlatformDevice = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
@@ -1426,7 +1426,7 @@ struct GmmLocalMemoryTests : public ::testing::Test, MockExecutionEnvironmentGmm
}
void SetUp() override {
MockExecutionEnvironmentGmmFixture::setUp();
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&localPlatformDevice);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&localPlatformDevice);
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
}

View File

@@ -174,7 +174,7 @@ class GTPinFixture : public ContextFixture, public MemoryManagementFixture {
pPlatform = platform();
auto executionEnvironment = pPlatform->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
memoryManager = new MockMemoryManagerWithFailures(*executionEnvironment);
memoryManager->pageFaultManager.reset(new MockResidentTestsPageFaultManager());

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -31,7 +31,7 @@ struct TimestampPacketTests : public ::testing::Test {
executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
device = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0u));

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2022 Intel Corporation
* Copyright (C) 2021-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -97,7 +97,7 @@ class GivenCacheFlushAfterWalkerEnabledAndProperSteppingIsSetWhenKernelArgIsSetA
const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily);
auto stepping = (isA0Stepping ? REVISION_A0 : REVISION_A1);
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(stepping, hardwareInfo);
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->setHwInfo(&hardwareInfo);
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->setHwInfoAndInitHelpers(&hardwareInfo);
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->initGmm();
CommandQueueHw<FamilyType> cmdQ(nullptr, pClDevice, 0, false);
@@ -220,7 +220,7 @@ class GivenCacheFlushAfterWalkerEnabledAndProperSteppingIsSetWhenAllocationRequi
const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily);
auto stepping = (isA0Stepping ? REVISION_A0 : REVISION_A1);
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(stepping, hardwareInfo);
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->setHwInfo(&hardwareInfo);
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->setHwInfoAndInitHelpers(&hardwareInfo);
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->initGmm();
MockKernelWithInternals mockKernel(*pClDevice, context, true);

View File

@@ -519,7 +519,7 @@ class CommandStreamReceiverMock : public CommandStreamReceiver {
CommandStreamReceiverMock() : BaseClass(*(new ExecutionEnvironment), 0, 1) {
this->mockExecutionEnvironment.reset(&this->executionEnvironment);
executionEnvironment.prepareRootDeviceEnvironments(1);
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment.initializeMemoryManager();
}
@@ -1139,7 +1139,7 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenMakeResidentIsCalledThenExportedFun
kernel->getResidency(residencySurfaces);
std::unique_ptr<NEO::ExecutionEnvironment> mockCsrExecEnv = std::make_unique<ExecutionEnvironment>();
mockCsrExecEnv->prepareRootDeviceEnvironments(1);
mockCsrExecEnv->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
mockCsrExecEnv->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
mockCsrExecEnv->initializeMemoryManager();
{
CommandStreamReceiverMock csrMock(*mockCsrExecEnv.get(), 0, 1);
@@ -1179,7 +1179,7 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenMakeResidentIsCalledThenGlobalBuffe
kernel->getResidency(residencySurfaces);
std::unique_ptr<NEO::ExecutionEnvironment> mockCsrExecEnv = std::make_unique<ExecutionEnvironment>();
mockCsrExecEnv->prepareRootDeviceEnvironments(1);
mockCsrExecEnv->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
mockCsrExecEnv->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
mockCsrExecEnv->initializeMemoryManager();
{
CommandStreamReceiverMock csrMock(*mockCsrExecEnv.get(), 0, 1);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2022 Intel Corporation
* Copyright (C) 2021-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -33,7 +33,7 @@ class ImageInLocalMemoryTest : public testing::Test {
platformsImpl->clear();
auto executionEnvironment = constructPlatform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1u);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&inputPlatformDevice);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&inputPlatformDevice);
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
mockMemoryManager = new MockMemoryManagerFailFirstAllocation(true, *executionEnvironment);

View File

@@ -1528,7 +1528,7 @@ using OsAgnosticMemoryManagerWithParams = ::testing::TestWithParam<bool>;
TEST_P(OsAgnosticMemoryManagerWithParams, givenReducedGpuAddressSpaceWhenAllocateGraphicsMemoryForHostPtrIsCalledThenAllocationWithoutFragmentsIsCreated) {
bool requiresL3Flush = GetParam();
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
if (executionEnvironment.rootDeviceEnvironments[0]->isFullRangeSvm() || is32bit) {
return;
}
@@ -1547,7 +1547,7 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenReducedGpuAddressSpaceWhenAllocat
TEST_P(OsAgnosticMemoryManagerWithParams, givenFullGpuAddressSpaceWhenAllocateGraphicsMemoryForHostPtrIsCalledThenAllocationWithFragmentsIsCreated) {
bool requiresL3Flush = GetParam();
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
if ((!executionEnvironment.rootDeviceEnvironments[0]->isFullRangeSvm()) || !defaultHwInfo->capabilityTable.hostPtrTrackingEnabled) {
GTEST_SKIP();
}
@@ -1573,7 +1573,7 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenDisabledHostPtrTrackingWhenAlloca
bool requiresL3Flush = GetParam();
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
if (!executionEnvironment.rootDeviceEnvironments[0]->isFullRangeSvm()) {
return;
}
@@ -1830,7 +1830,7 @@ TEST(MemoryManager, givenBufferHostMemoryAndHostPtrTrackingDisabledWhenAllocatin
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
HardwareInfo hwInfoLocal = *defaultHwInfo;
hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = false;
executionEnvironment->rootDeviceEnvironments[0u]->setHwInfo(&hwInfoLocal);
executionEnvironment->rootDeviceEnvironments[0u]->setHwInfoAndInitHelpers(&hwInfoLocal);
executionEnvironment->rootDeviceEnvironments[0u]->initGmm();
MockMemoryManager memoryManager(false, true, *executionEnvironment);
@@ -1853,7 +1853,7 @@ TEST(MemoryManager, givenBufferHostMemoryAndHostPtrTrackingDisabledAndForce32bit
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
HardwareInfo hwInfoLocal = *defaultHwInfo;
hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = false;
executionEnvironment->rootDeviceEnvironments[0u]->setHwInfo(&hwInfoLocal);
executionEnvironment->rootDeviceEnvironments[0u]->setHwInfoAndInitHelpers(&hwInfoLocal);
executionEnvironment->rootDeviceEnvironments[0u]->initGmm();
MockMemoryManager memoryManager(false, true, *executionEnvironment);
@@ -2872,7 +2872,7 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingModeThenNonSv
HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingModeThenNonSvmBufferIsNotSet) {
HardwareInfo hwInfoLocal = *defaultHwInfo;
hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = true;
memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->setHwInfo(&hwInfoLocal);
memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->setHwInfoAndInitHelpers(&hwInfoLocal);
int buffer = 0;
EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::EXTERNAL_HOST_PTR, 0u));
EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::BUFFER_HOST_MEMORY, 0u));
@@ -2881,7 +2881,7 @@ HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingModeThenNonSv
HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenHostPtrTrackingDisabledAnd64bitsThenNonSvmBufferIsSetForBufferHostMemory) {
HardwareInfo hwInfoLocal = *defaultHwInfo;
hwInfoLocal.capabilityTable.hostPtrTrackingEnabled = false;
memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->setHwInfo(&hwInfoLocal);
memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->setHwInfoAndInitHelpers(&hwInfoLocal);
int buffer = 0;
EXPECT_FALSE(memoryManager->isNonSvmBuffer(&buffer, AllocationType::EXTERNAL_HOST_PTR, 0u));
EXPECT_EQ(!is32bit, memoryManager->isNonSvmBuffer(&buffer, AllocationType::BUFFER_HOST_MEMORY, 0u));
@@ -2904,7 +2904,7 @@ HWTEST_F(PageTableManagerTest, givenPageTableManagerWhenMapAuxGpuVaThenForAllEng
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
@@ -2954,7 +2954,7 @@ HWTEST_F(PageTableManagerTest, givenPageTableManagerWhenUpdateAuxTableGmmErrorTh
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
@@ -2988,7 +2988,7 @@ HWTEST_F(PageTableManagerTest, givenNullPageTableManagerWhenMapAuxGpuVaThenNoThr
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
@@ -3018,7 +3018,7 @@ HWTEST_F(PageTableManagerTest, givenNullPageTableManagerWhenMapAuxGpuVaThenRetur
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
@@ -3045,7 +3045,7 @@ HWTEST_F(PageTableManagerTest, givenMemoryManagerThatSupportsPageTableManagerWhe
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
auto memoryManager = new MockMemoryManager(false, false, *executionEnvironment);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -74,7 +74,7 @@ class MockClDevice : public ClDevice {
executionEnvironment->prepareRootDeviceEnvironments(numRootDevices);
pHwInfo = pHwInfo ? pHwInfo : defaultHwInfo.get();
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(pHwInfo);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(pHwInfo);
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
executionEnvironment->calculateMaxOsContextCount();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -332,7 +332,7 @@ TEST(DeviceFactory, givenCreateMultipleRootDevicesWhenCreateDevicesIsCalledThenV
executionEnvironment->prepareRootDeviceEnvironments(numRootDevices);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
hwInfo[i] = *NEO::defaultHwInfo.get();
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(&hwInfo[i]);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(&hwInfo[i]);
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo()->capabilityTable.isIntegratedDevice = true;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -355,7 +355,7 @@ void PerformanceCountersMetricsLibraryFixture::tearDown() {
PerformanceCountersFixture::PerformanceCountersFixture() {
executionEnvironment = std::make_unique<MockExecutionEnvironment>();
rootDeviceEnvironment = std::make_unique<RootDeviceEnvironment>(*executionEnvironment);
rootDeviceEnvironment->setHwInfo(defaultHwInfo.get());
rootDeviceEnvironment->setHwInfoAndInitHelpers(defaultHwInfo.get());
}
//////////////////////////////////////////////////////

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -89,7 +89,7 @@ TEST(OSTimeWinTests, givenNoOSInterfaceWhenGetCpuGpuTimeThenReturnsError) {
TEST(OSTimeWinTests, givenOSInterfaceWhenGetCpuGpuTimeThenReturnsSuccess) {
MockExecutionEnvironment executionEnvironment;
RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment);
rootDeviceEnvironment.setHwInfo(defaultHwInfo.get());
rootDeviceEnvironment.setHwInfoAndInitHelpers(defaultHwInfo.get());
auto wddm = new WddmMock(rootDeviceEnvironment);
TimeStampData CPUGPUTime01 = {0};
TimeStampData CPUGPUTime02 = {0};

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -55,7 +55,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenShareableAllocationWhenAllocateInDevice
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
hwInfo.featureTable.flags.ftrLocalMemory = true;
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
memoryManager = std::make_unique<MockWddmMemoryManager>(false, localMemoryEnabled, *executionEnvironment);
@@ -90,7 +90,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenShareableAllocationWhenAllocateGraphics
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
hwInfo.featureTable.flags.ftrLocalMemory = true;
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&hwInfo);
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
memoryManager = std::make_unique<MockWddmMemoryManager>(false, localMemoryEnabled, *executionEnvironment);
@@ -488,7 +488,7 @@ class WddmMemoryManagerSimpleTestWithLocalMemory : public MockWddmMemoryManagerF
platformsImpl->clear();
auto executionEnvironment = constructPlatform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1u);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&localPlatformDevice);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(&localPlatformDevice);
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
MockWddmMemoryManagerFixture::SetUp();

View File

@@ -499,7 +499,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSingleEngineRegister
TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValuesOnMultipleEnginesRegisteredWhenHandleFenceCompletionIsCalledThenWaitOnCpuForEachEngine) {
executionEnvironment->prepareRootDeviceEnvironments(2u);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
const uint32_t rootDeviceIndex = 1;
@@ -537,7 +537,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSomeOfMultipleEngine
const uint32_t rootDeviceIndex = 1;
executionEnvironment->prepareRootDeviceEnvironments(2u);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
DeviceBitfield deviceBitfield(2);
@@ -862,7 +862,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenAllocateGraphicsMemory
auto size = MemoryConstants::pageSize;
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.ftrRenderCompressedBuffers = true;
rootDeviceEnvironment->setHwInfo(&hwInfo);
rootDeviceEnvironment->setHwInfoAndInitHelpers(&hwInfo);
auto memoryManager = std::make_unique<MockWddmMemoryManager>(true, false, *executionEnvironment);
if (memoryManager->isLimitedGPU(0)) {
@@ -929,7 +929,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenAllocateGraphicsMemory
auto size = MemoryConstants::pageSize;
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.ftrRenderCompressedBuffers = true;
rootDeviceEnvironment->setHwInfo(&hwInfo);
rootDeviceEnvironment->setHwInfoAndInitHelpers(&hwInfo);
auto memoryManager = std::make_unique<MockWddmMemoryManager>(false, false, *executionEnvironment);
memoryManager->allocateGraphicsMemoryInNonDevicePool = true;
@@ -1920,7 +1920,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerAnd32bitBuildThenSvmPartitio
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWhenCallingIsMemoryBudgetExhaustedThenReturnFalse) {
executionEnvironment->prepareRootDeviceEnvironments(3u);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
executionEnvironment->initializeMemoryManager();
@@ -1945,7 +1945,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWhenC
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWithExhaustedMemoryBudgetWhenCallingIsMemoryBudgetExhaustedThenReturnTrue) {
executionEnvironment->prepareRootDeviceEnvironments(3u);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
executionEnvironment->initializeMemoryManager();

View File

@@ -2041,7 +2041,7 @@ TEST_F(ProgramTests, GivenNoCompilerInterfaceRootDeviceEnvironmentWhenRebuilding
auto pDevice = pContext->getDevice(0);
auto executionEnvironment = pDevice->getExecutionEnvironment();
std::unique_ptr<RootDeviceEnvironment> rootDeviceEnvironment = std::make_unique<NoCompilerInterfaceRootDeviceEnvironment>(*executionEnvironment);
rootDeviceEnvironment->setHwInfo(&pDevice->getHardwareInfo());
rootDeviceEnvironment->setHwInfoAndInitHelpers(&pDevice->getHardwareInfo());
std::swap(rootDeviceEnvironment, executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
auto program = std::make_unique<MockProgram>(toClDeviceVector(*pDevice));
EXPECT_NE(nullptr, program);
@@ -2796,7 +2796,7 @@ TEST_F(setProgramSpecializationConstantTests, givenInvalidGetSpecConstantsInfoRe
TEST(setProgramSpecializationConstantTest, givenUninitializedCompilerinterfaceWhenSetProgramSpecializationConstantThenErrorIsReturned) {
auto executionEnvironment = new MockExecutionEnvironment();
executionEnvironment->rootDeviceEnvironments[0] = std::make_unique<NoCompilerInterfaceRootDeviceEnvironment>(*executionEnvironment);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
MockClDevice mockDevice(new MockDevice{executionEnvironment, 0});

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -664,7 +664,7 @@ TEST(SourceLevelDebugger, givenTwoRootDevicesWhenSecondIsCreatedThenCreatingNewS
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
auto device1 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
@@ -688,7 +688,7 @@ TEST(SourceLevelDebugger, givenMultipleRootDevicesWhenCreatedThenUseDedicatedSou
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
}
auto device1 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0u));

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -20,7 +20,7 @@ void NEO::UltConfigListener::OnTestStart(const ::testing::TestInfo &testInfo) {
auto executionEnvironment = constructPlatform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
executionEnvironment->calculateMaxOsContextCount();
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
}