Remove platformDevices from os_interface, platform, program, sharings

and source_level_debugger

Related-To: NEO-4499
Change-Id: I09c28e8c167b00b80eaff8f86c8e58cea78ed3b1
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski 2020-03-24 17:52:43 +01:00 committed by sys_ocldev
parent 7d37c5a5d9
commit 25aea40e84
24 changed files with 56 additions and 56 deletions

View File

@ -29,7 +29,7 @@ OsLibrary *setAdapterInfo(const PLATFORM *platform, const GT_SYSTEM_INFO *gtSyst
struct DeviceFactoryTest : public ::testing::Test {
public:
void SetUp() override {
const HardwareInfo *hwInfo = platformDevices[0];
const HardwareInfo *hwInfo = defaultHwInfo.get();
executionEnvironment = platform()->peekExecutionEnvironment();
mockGdiDll = setAdapterInfo(&hwInfo->platform, &hwInfo->gtSystemInfo, hwInfo->capabilityTable.gpuAddressSpace);
}
@ -44,7 +44,7 @@ struct DeviceFactoryTest : public ::testing::Test {
};
TEST_F(DeviceFactoryTest, PrepareDeviceEnvironments_Check_HwInfo_Platform) {
const HardwareInfo *refHwinfo = *platformDevices;
const HardwareInfo *refHwinfo = defaultHwInfo.get();
bool success = DeviceFactory::prepareDeviceEnvironments(*executionEnvironment);
EXPECT_TRUE(success);
@ -149,7 +149,7 @@ TEST_F(DeviceFactoryTest, whenPrepareDeviceEnvironmentsIsCalledThenAllRootDevice
auto requiredDeviceCount = 2u;
DebugManager.flags.CreateMultipleRootDevices.set(requiredDeviceCount);
MockExecutionEnvironment executionEnvironment(*platformDevices, true, requiredDeviceCount);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get(), true, requiredDeviceCount);
bool success = DeviceFactory::prepareDeviceEnvironments(executionEnvironment);
ASSERT_TRUE(success);
@ -175,7 +175,7 @@ TEST_F(DeviceFactoryTest, givenInvalidHwConfigStringPrepareDeviceEnvironmentsFor
DebugManagerStateRestore stateRestore;
DebugManager.flags.HardwareInfoOverride.set("1x3");
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
bool success = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);
EXPECT_FALSE(success);
@ -185,7 +185,7 @@ TEST_F(DeviceFactoryTest, givenValidHwConfigStringPrepareDeviceEnvironmentsForPr
DebugManagerStateRestore stateRestore;
DebugManager.flags.HardwareInfoOverride.set("1x1x1");
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
EXPECT_ANY_THROW(DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment));
}

View File

@ -337,7 +337,7 @@ class DrmMockCustom : public Drm {
DrmMockCustom() : Drm(std::make_unique<HwDeviceId>(mockFd), *constructPlatform()->peekExecutionEnvironment()->rootDeviceEnvironments[0]) {
reset();
ioctl_expected.contextCreate = static_cast<int>(NEO::HwHelper::get(NEO::defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*NEO::platformDevices[0]).size());
ioctl_expected.contextCreate = static_cast<int>(NEO::HwHelper::get(NEO::defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*NEO::defaultHwInfo).size());
ioctl_expected.contextDestroy = ioctl_expected.contextCreate.load();
}
int getErrno() override {

View File

@ -13,7 +13,7 @@
#include "shared/test/unit_test/helpers/default_hw_info.h"
TEST_F(DeviceFactoryLinuxTest, PrepareDeviceEnvironmentsCheckEUCntSSCnt) {
const HardwareInfo *refHwinfo = *platformDevices;
const HardwareInfo *refHwinfo = defaultHwInfo.get();
pDrm->StoredEUVal = 11;
pDrm->StoredSSVal = 8;

View File

@ -25,7 +25,7 @@ using namespace ::testing;
namespace NEO {
TEST(DeviceOsTest, GivenDefaultClDeviceWhenCheckingForOsSpecificExtensionsThenCorrectExtensionsAreSet) {
auto hwInfo = *platformDevices;
auto hwInfo = defaultHwInfo.get();
auto pDevice = MockDevice::createWithNewExecutionEnvironment<Device>(hwInfo);
auto pClDevice = new ClDevice{*pDevice, platform()};
@ -42,7 +42,7 @@ TEST(DeviceOsTest, GivenDefaultClDeviceWhenCheckingForOsSpecificExtensionsThenCo
}
TEST(DeviceOsTest, supportedSimultaneousInterops) {
auto pDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
auto pDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
std::vector<unsigned int> expected = {0};
@ -50,7 +50,7 @@ TEST(DeviceOsTest, supportedSimultaneousInterops) {
}
TEST(DeviceOsTest, DeviceCreationFail) {
auto hwInfo = *platformDevices;
auto hwInfo = defaultHwInfo.get();
auto pDevice = MockDevice::createWithNewExecutionEnvironment<FailDevice>(hwInfo);
EXPECT_THAT(pDevice, nullptr);
@ -101,7 +101,7 @@ TEST(ApiOsTest, notSupportedApiList) {
TEST(DeviceOsTest, DeviceCreationFailMidThreadPreemption) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.ForcePreemptionMode.set(static_cast<int32_t>(PreemptionMode::MidThread));
auto pDevice = MockDevice::createWithNewExecutionEnvironment<FailDeviceAfterOne>(*platformDevices);
auto pDevice = MockDevice::createWithNewExecutionEnvironment<FailDeviceAfterOne>(defaultHwInfo.get());
EXPECT_THAT(pDevice, nullptr);
}

View File

@ -48,7 +48,7 @@ HWTEST_F(DrmCommandStreamMMTest, givenForcePinDisabledWhenMemoryManagerIsCreated
auto drm = new DrmMockCustom();
MockExecutionEnvironment executionEnvironment;
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(*platformDevices);
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setDrm(drm);
@ -66,7 +66,7 @@ HWTEST_F(DrmCommandStreamMMTest, givenExecutionEnvironmentWithMoreThanOneRootDev
executionEnvironment.prepareRootDeviceEnvironments(2);
for (uint32_t rootDeviceIndex = 0; rootDeviceIndex < executionEnvironment.rootDeviceEnvironments.size(); rootDeviceIndex++) {
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->setHwInfo(*platformDevices);
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->setHwInfo(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->osInterface->get()->setDrm(new DrmMockCustom());
executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface = std::make_unique<DrmMemoryOperationsHandler>();

View File

@ -1386,7 +1386,7 @@ struct MockDrmCsr : public DrmCommandStreamReceiver<GfxFamily> {
HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamReceiverWhenCreatePageTableMngrIsCalledThenCreatePageTableManager) {
executionEnvironment.prepareRootDeviceEnvironments(2);
executionEnvironment.rootDeviceEnvironments[1]->setHwInfo(*platformDevices);
executionEnvironment.rootDeviceEnvironments[1]->setHwInfo(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[1]->initGmm();
executionEnvironment.rootDeviceEnvironments[1]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[1]->osInterface->get()->setDrm(new DrmMockCustom());

View File

@ -56,7 +56,7 @@ class DrmMockForWorker : public Drm {
class DrmGemCloseWorkerFixture {
public:
DrmGemCloseWorkerFixture() : executionEnvironment(*platformDevices){};
DrmGemCloseWorkerFixture() : executionEnvironment(defaultHwInfo.get()){};
//max loop count for while
static const uint32_t deadCntInit = 10 * 1000 * 1000;

View File

@ -21,7 +21,7 @@ using namespace NEO;
using AllocationData = TestedDrmMemoryManager::AllocationData;
TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenAllocateInDevicePoolIsCalledThenNullptrAndStatusRetryIsReturned) {
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setDrm(Drm::create(nullptr, *executionEnvironment.rootDeviceEnvironments[0]));
TestedDrmMemoryManager memoryManager(executionEnvironment);
@ -37,7 +37,7 @@ TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenAllocateInDevicePoolIs
}
TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenLockResourceIsCalledOnNullBufferObjectThenReturnNullPtr) {
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
TestedDrmMemoryManager memoryManager(executionEnvironment);
DrmAllocation drmAllocation(0, GraphicsAllocation::AllocationType::UNKNOWN, nullptr, nullptr, 0u, 0u, MemoryPool::LocalMemory);
@ -49,7 +49,7 @@ TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenLockResourceIsCalledOn
}
TEST(DrmMemoryManagerSimpleTest, givenDrmMemoryManagerWhenFreeGraphicsMemoryIsCalledOnAllocationWithNullBufferObjectThenEarlyReturn) {
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
TestedDrmMemoryManager memoryManager(executionEnvironment);

View File

@ -513,7 +513,7 @@ TEST(DrmMemoryManagerTest2, givenDrmMemoryManagerWhengetSystemSharedMemoryIsCall
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(4u);
for (auto i = 0u; i < 4u; i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(*platformDevices);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
}
auto memoryManager = std::make_unique<TestedDrmMemoryManager>(false, false, false, *executionEnvironment);
@ -545,7 +545,7 @@ TEST(DrmMemoryManagerTest2, getMinimumSystemSharedMemory) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(4u);
for (auto i = 0u; i < 4u; i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(*platformDevices);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
}
auto memoryManager = std::make_unique<TestedDrmMemoryManager>(false, false, false, *executionEnvironment);
for (auto i = 0u; i < 4u; i++) {
@ -3346,7 +3346,7 @@ TEST(DrmMemoryManagerWithExplicitExpectationsTest2, whenObtainFdFromHandleIsCall
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(4u);
for (auto i = 0u; i < 4u; i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(*platformDevices);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
}
auto memoryManager = std::make_unique<TestedDrmMemoryManager>(false, false, false, *executionEnvironment);
for (auto i = 0u; i < 4u; i++) {
@ -3457,7 +3457,7 @@ class GMockDrmMemoryManager : public TestedDrmMemoryManager {
};
TEST(DrmMemoryManagerFreeGraphicsMemoryCallSequenceTest, givenDrmMemoryManagerAndFreeGraphicsMemoryIsCalledThenUnreferenceBufferObjectIsCalledFirstWithSynchronousDestroySetToTrue) {
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setDrm(Drm::create(nullptr, *executionEnvironment.rootDeviceEnvironments[0]));
GMockDrmMemoryManager gmockDrmMemoryManager(executionEnvironment);
@ -3477,7 +3477,7 @@ TEST(DrmMemoryManagerFreeGraphicsMemoryCallSequenceTest, givenDrmMemoryManagerAn
}
TEST(DrmMemoryManagerFreeGraphicsMemoryUnreferenceTest, givenDrmMemoryManagerAndFreeGraphicsMemoryIsCalledForSharedAllocationThenUnreferenceBufferObjectIsCalledWithSynchronousDestroySetToFalse) {
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setDrm(Drm::create(nullptr, *executionEnvironment.rootDeviceEnvironments[0]));
::testing::NiceMock<GMockDrmMemoryManager> gmockDrmMemoryManager(executionEnvironment);

View File

@ -24,7 +24,7 @@ using AllocationData = TestedDrmMemoryManager::AllocationData;
class DrmMemoryManagerBasic : public ::testing::Test {
public:
DrmMemoryManagerBasic() : executionEnvironment(*platformDevices){};
DrmMemoryManagerBasic() : executionEnvironment(defaultHwInfo.get()){};
void SetUp() override {
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setDrm(Drm::create(nullptr, *executionEnvironment.rootDeviceEnvironments[0]));
@ -47,7 +47,7 @@ class DrmMemoryManagerFixture : public MemoryManagementFixture {
void SetUp(DrmMockCustom *mock, bool localMemoryEnabled) {
this->mock = mock;
executionEnvironment = new MockExecutionEnvironment(*platformDevices);
executionEnvironment = new MockExecutionEnvironment(defaultHwInfo.get());
executionEnvironment->incRefInternal();
rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get();
rootDeviceEnvironment->osInterface = std::make_unique<OSInterface>();
@ -59,7 +59,7 @@ class DrmMemoryManagerFixture : public MemoryManagementFixture {
if (memoryManager->getgemCloseWorker()) {
memoryManager->getgemCloseWorker()->close(true);
}
device = new MockClDevice{MockDevice::createWithExecutionEnvironment<MockDevice>(*platformDevices, executionEnvironment, 0)};
device = new MockClDevice{MockDevice::createWithExecutionEnvironment<MockDevice>(defaultHwInfo.get(), executionEnvironment, 0)};
}
void TearDown() override {
@ -97,7 +97,7 @@ class DrmMemoryManagerFixtureWithoutQuietIoctlExpectation {
void SetUp() {
executionEnvironment = new ExecutionEnvironment;
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(*platformDevices);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
mock = new DrmMockCustom();
executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->setDrm(mock);
@ -107,7 +107,7 @@ class DrmMemoryManagerFixtureWithoutQuietIoctlExpectation {
if (memoryManager->getgemCloseWorker()) {
memoryManager->getgemCloseWorker()->close(true);
}
device.reset(MockDevice::createWithExecutionEnvironment<MockDevice>(*platformDevices, executionEnvironment, 0));
device.reset(MockDevice::createWithExecutionEnvironment<MockDevice>(defaultHwInfo.get(), executionEnvironment, 0));
}
void TearDown() {

View File

@ -31,7 +31,7 @@ class DrmMockDefault : public DrmMock {
Drm **pDrmToReturnFromCreateFunc = nullptr;
Drm *Drm::create(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) {
rootDeviceEnvironment.setHwInfo(platformDevices[0]);
rootDeviceEnvironment.setHwInfo(defaultHwInfo.get());
if (pDrmToReturnFromCreateFunc) {
return *pDrmToReturnFromCreateFunc;
}

View File

@ -21,7 +21,7 @@ using namespace ::testing;
namespace NEO {
TEST(DeviceOsTest, GivenDefaultClDeviceWhenCheckingForOsSpecificExtensionsThenCorrectExtensionsAreSet) {
auto hwInfo = *platformDevices;
auto hwInfo = defaultHwInfo.get();
auto pDevice = MockDevice::createWithNewExecutionEnvironment<Device>(hwInfo);
auto pClDevice = new ClDevice{*pDevice, platform()};
@ -39,7 +39,7 @@ TEST(DeviceOsTest, GivenDefaultClDeviceWhenCheckingForOsSpecificExtensionsThenCo
}
TEST(DeviceOsTest, supportedSimultaneousInterops) {
auto pDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
auto pDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
std::vector<unsigned int> expected = {CL_GL_CONTEXT_KHR,
CL_WGL_HDC_KHR,
@ -57,7 +57,7 @@ TEST(DeviceOsTest, supportedSimultaneousInterops) {
}
TEST(DeviceOsTest, DeviceCreationFail) {
auto hwInfo = *platformDevices;
auto hwInfo = defaultHwInfo.get();
auto pDevice = MockDevice::createWithNewExecutionEnvironment<FailDevice>(hwInfo);
EXPECT_THAT(pDevice, nullptr);
@ -66,7 +66,7 @@ TEST(DeviceOsTest, DeviceCreationFail) {
TEST(DeviceOsTest, DeviceCreationFailMidThreadPreemption) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.ForcePreemptionMode.set(static_cast<int32_t>(PreemptionMode::MidThread));
auto pDevice = MockDevice::createWithNewExecutionEnvironment<FailDeviceAfterOne>(*platformDevices);
auto pDevice = MockDevice::createWithNewExecutionEnvironment<FailDeviceAfterOne>(defaultHwInfo.get());
EXPECT_THAT(pDevice, nullptr);
}

View File

@ -39,7 +39,7 @@ CommandStreamReceiver *createMockCommandStreamReceiver(bool withAubDump, Executi
class DriverInfoDeviceTest : public ::testing::Test {
public:
void SetUp() {
hwInfo = platformDevices[0];
hwInfo = defaultHwInfo.get();
commandStreamReceiverCreateFunc = commandStreamReceiverFactory[hwInfo->platform.eRenderCoreFamily];
commandStreamReceiverFactory[hwInfo->platform.eRenderCoreFamily] = createMockCommandStreamReceiver;
}

View File

@ -18,7 +18,7 @@ OsLibrary *setAdapterInfo(const PLATFORM *platform, const GT_SYSTEM_INFO *gtSyst
struct GdiDllFixture {
virtual void SetUp() {
const HardwareInfo *hwInfo = platformDevices[0];
const HardwareInfo *hwInfo = defaultHwInfo.get();
mockGdiDll.reset(setAdapterInfo(&hwInfo->platform, &hwInfo->gtSystemInfo, hwInfo->capabilityTable.gpuAddressSpace));
setSizesFcn = reinterpret_cast<decltype(&MockSetSizes)>(mockGdiDll->getProcAddress("MockSetSizes"));

View File

@ -128,7 +128,7 @@ TEST(WddmDiscoverDevices, WhenAdapterDescriptionContainsVirtualRenderThenAdapter
TEST(Wddm20EnumAdaptersTest, expectTrue) {
const HardwareInfo *hwInfo = platformDevices[0];
const HardwareInfo *hwInfo = defaultHwInfo.get();
std::unique_ptr<OsLibrary> mockGdiDll(setAdapterInfo(&hwInfo->platform,
&hwInfo->gtSystemInfo,
hwInfo->capabilityTable.gpuAddressSpace));
@ -144,7 +144,7 @@ TEST(Wddm20EnumAdaptersTest, expectTrue) {
}
TEST(Wddm20EnumAdaptersTest, givenEmptyHardwareInfoWhenEnumAdapterIsCalledThenCapabilityTableIsSet) {
const HardwareInfo *hwInfo = platformDevices[0];
const HardwareInfo *hwInfo = defaultHwInfo.get();
std::unique_ptr<OsLibrary> mockGdiDll(setAdapterInfo(&hwInfo->platform,
&hwInfo->gtSystemInfo,
hwInfo->capabilityTable.gpuAddressSpace));

View File

@ -350,7 +350,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(*platformDevices);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
}
std::unique_ptr<CommandStreamReceiver> csr(createCommandStream(*executionEnvironment, 1u));
@ -383,7 +383,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValuesOnMultipleEnginesRegi
TEST_F(WddmMemoryManagerSimpleTest, givenNonZeroFenceValueOnSomeOfMultipleEnginesRegisteredWhenHandleFenceCompletionIsCalledThenWaitOnCpuForTheseEngines) {
executionEnvironment->prepareRootDeviceEnvironments(2u);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(*platformDevices);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
}
std::unique_ptr<CommandStreamReceiver> csr(createCommandStream(*executionEnvironment, 1u));
@ -692,7 +692,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageIsBeingCreat
GTEST_SKIP();
}
auto device = std::make_unique<MockClDevice>(MockDevice::createWithExecutionEnvironment<MockDevice>(*platformDevices, executionEnvironment, 0u));
auto device = std::make_unique<MockClDevice>(MockDevice::createWithExecutionEnvironment<MockDevice>(defaultHwInfo.get(), executionEnvironment, 0u));
MockContext context(device.get());
context.memoryManager = memoryManager.get();
@ -1450,7 +1450,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(*platformDevices);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
}
executionEnvironment->initializeMemoryManager();
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
@ -1475,7 +1475,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(*platformDevices);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
}
executionEnvironment->initializeMemoryManager();
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {

View File

@ -227,7 +227,7 @@ class PlatformFailingTest : public PlatformTest {
}
void SetUp() override {
PlatformTest::SetUp();
hwInfo = platformDevices[0];
hwInfo = defaultHwInfo.get();
commandStreamReceiverCreateFunc = commandStreamReceiverFactory[hwInfo->platform.eRenderCoreFamily];
commandStreamReceiverFactory[hwInfo->platform.eRenderCoreFamily] = createMockCommandStreamReceiver;
}
@ -252,7 +252,7 @@ TEST_F(PlatformFailingTest, givenPlatformInitializationWhenIncorrectHwInfoThenIn
TEST_F(PlatformTest, givenSupportingCl21WhenPlatformSupportsFp64ThenFillMatchingSubstringsAndMandatoryTrailingSpace) {
const HardwareInfo *hwInfo;
hwInfo = platformDevices[0];
hwInfo = defaultHwInfo.get();
std::string extensionsList = getExtensionsList(*hwInfo);
std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str());
@ -307,7 +307,7 @@ TEST_F(PlatformTest, givenNotSupportingCl21WhenPlatformNotSupportFp64ThenNotFill
TEST_F(PlatformTest, givenFtrSupportAtomicsWhenCreateExtentionsListThenGetMatchingSubstrings) {
const HardwareInfo *hwInfo;
hwInfo = platformDevices[0];
hwInfo = defaultHwInfo.get();
std::string extensionsList = getExtensionsList(*hwInfo);
std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str());
@ -395,7 +395,7 @@ TEST(PlatformInitTest, givenInitializedPlatformWhenInitializeIsCalledOneMoreTime
TEST(PlatformInitTest, givenSingleDeviceWithNonZeroRootDeviceIndexInPassedDeviceVectorWhenInitializePlatformThenCreateOnlyOneClDevice) {
std::vector<std::unique_ptr<Device>> devices;
auto executionEnvironment = new MockExecutionEnvironment(*platformDevices, false, 3);
auto executionEnvironment = new MockExecutionEnvironment(defaultHwInfo.get(), false, 3);
devices.push_back(std::make_unique<MockDevice>(executionEnvironment, 2));
auto status = platform()->initialize(std::move(devices));
EXPECT_TRUE(status);

View File

@ -106,7 +106,7 @@ TEST(KernelInfo, decodeImageKernelArgument) {
TEST(KernelInfoTest, givenKernelInfoWhenCreateKernelAllocationThenCopyWholeKernelHeapToKernelAllocation) {
KernelInfo kernelInfo;
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
OsAgnosticMemoryManager memoryManager(executionEnvironment);
SKernelBinaryHeaderCommon kernelHeader;
const size_t heapSize = 0x40;
@ -135,7 +135,7 @@ class MyMemoryManager : public OsAgnosticMemoryManager {
TEST(KernelInfoTest, givenKernelInfoWhenCreateKernelAllocationAndCannotAllocateMemoryThenReturnsFalse) {
KernelInfo kernelInfo;
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
MyMemoryManager memoryManager(executionEnvironment);
SKernelBinaryHeaderCommon kernelHeader;
kernelInfo.heapInfo.pKernelHeader = &kernelHeader;

View File

@ -2757,7 +2757,7 @@ TEST_F(setProgramSpecializationConstantTests, givenInvalidGetSpecConstantsInfoRe
TEST(setProgramSpecializationConstantTest, givenUninitializedCompilerinterfaceWhenSetProgramSpecializationConstantThenErrorIsReturned) {
auto executionEnvironment = new MockExecutionEnvironment();
executionEnvironment->rootDeviceEnvironments[0] = std::make_unique<NoCompilerInterfaceRootDeviceEnvironment>(*executionEnvironment);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(*platformDevices);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
MockDevice mockDevice(executionEnvironment, 0);
SpecializationConstantProgramMock mockProgram(*executionEnvironment);
mockProgram.setDevice(&mockDevice);

View File

@ -26,7 +26,7 @@ class CreateFromGlTexture : public ::testing::Test {
// temp solution - we need to query size from GMM:
class TempMM : public OsAgnosticMemoryManager {
public:
TempMM() : OsAgnosticMemoryManager(*(new MockExecutionEnvironment(*platformDevices))) {
TempMM() : OsAgnosticMemoryManager(*(new MockExecutionEnvironment(defaultHwInfo.get()))) {
mockExecutionEnvironment.reset(&executionEnvironment);
}
GraphicsAllocation *createGraphicsAllocationFromSharedHandle(osHandle handle, const AllocationProperties &properties, bool requireSpecificBitness) override {

View File

@ -219,7 +219,7 @@ TEST(Context, givenMockSharingBuilderWhenContextWithInvalidPropertiesThenContext
stateRestore.clearCurrentState();
stateRestore.registerSharing<MockSharingBuilderFactory>(SharingType::CLGL_SHARING);
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
cl_device_id clDevice = device.get();
auto deviceVector = ClDeviceVector(&clDevice, 1);

View File

@ -19,7 +19,7 @@ namespace NEO {
template <bool validContext>
struct UnifiedSharingContextFixture : ::testing::Test {
void SetUp() override {
device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
cl_device_id deviceId = device.get();
deviceVector = std::make_unique<ClDeviceVector>(&deviceId, 1);
if (validContext) {

View File

@ -19,7 +19,7 @@
using namespace NEO;
TEST(UnifiedSharingTests, givenContextCreatedWithExternalDeviceHandlePropertyWhenGettingUnifiedSharingThenReturnIt) {
MockClDevice device{MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices)};
MockClDevice device{MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get())};
cl_device_id deviceId = &device;
ClDeviceVector allDevs(&deviceId, 1);
cl_int retVal{};

View File

@ -474,7 +474,7 @@ TEST(SourceLevelDebugger, givenKernelDebuggerLibraryActiveWhenDeviceImplIsCreate
DebuggerLibrary::setDebuggerActive(true);
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
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()->getDeviceHandle() : 0;
@ -539,7 +539,7 @@ TEST(SourceLevelDebugger, givenTwoRootDevicesWhenSecondIsCreatedThenCreatingNewS
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(*platformDevices);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
}
auto device1 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
EXPECT_NE(nullptr, executionEnvironment->memoryManager);
@ -562,7 +562,7 @@ TEST(SourceLevelDebugger, givenMultipleRootDevicesWhenTheyAreCreatedTheyUseDedic
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(2);
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(*platformDevices);
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
}
auto device1 = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
auto sourceLevelDebugger = device1->getDebugger();