Remove platformDevices from ULT

Related-To: NEO-4499

Change-Id: I0949f6fd9897b970314a82db7bae6f700fbf31d3
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-03-24 18:19:49 +01:00
committed by sys_ocldev
parent 43668ce55b
commit 94bd9af6e2
22 changed files with 39 additions and 39 deletions

View File

@@ -93,7 +93,7 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenInvalidArgIndexWhenSettingKernelArgTh
}
TEST_F(clSetKernelArgSVMPointerTests, GivenDeviceNotSupportingSvmWhenSettingKernelArgSVMPointerThenInvalidOperationErrorIsReturned) {
auto hwInfo = *platformDevices[0];
auto hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.ftrSvm = false;
auto pDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));

View File

@@ -66,7 +66,7 @@ TEST_F(clSetKernelExecInfoTests, GivenNullKernelWhenSettingAdditionalKernelInfoT
}
TEST_F(clSetKernelArgSVMPointerTests, GivenDeviceNotSupportingSvmWhenSettingKernelExecInfoThenInvalidOperationErrorIsReturned) {
auto hwInfo = *platformDevices[0];
auto hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.ftrSvm = false;
auto pDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));

View File

@@ -23,7 +23,7 @@ TEST(AubCenter, GivenUseAubStreamDebugVariableNotSetWhenAubCenterIsCreatedThenAu
DebugManagerStateRestore restorer;
DebugManager.flags.UseAubStream.set(false);
MockAubCenter aubCenter(platformDevices[0], false, "", CommandStreamReceiverType::CSR_AUB);
MockAubCenter aubCenter(defaultHwInfo.get(), false, "", CommandStreamReceiverType::CSR_AUB);
EXPECT_EQ(nullptr, aubCenter.aubManager.get());
}
@@ -32,7 +32,7 @@ TEST(AubCenter, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenCreat
DebugManager.flags.UseAubStream.set(false);
MockAubManager *mockAubManager = new MockAubManager(defaultHwInfo->platform.eProductFamily, 4, 8 * MB, true, aub_stream::mode::aubFile, defaultHwInfo->capabilityTable.gpuAddressSpace);
MockAubCenter mockAubCenter(platformDevices[0], false, "", CommandStreamReceiverType::CSR_AUB);
MockAubCenter mockAubCenter(defaultHwInfo.get(), false, "", CommandStreamReceiverType::CSR_AUB);
mockAubCenter.aubManager = std::unique_ptr<MockAubManager>(mockAubManager);
EXPECT_EQ(defaultHwInfo->platform.eProductFamily, mockAubManager->mockAubManagerParams.productFamily);
@@ -98,14 +98,14 @@ TEST(AubCenter, GivenSetCommandStreamReceiverFlagEqualDefaultHwWhenAubManagerIsC
CommandStreamReceiverType::CSR_AUB};
for (auto type : aubTypes) {
MockAubCenter aubCenter(platformDevices[0], true, "test", type);
MockAubCenter aubCenter(defaultHwInfo.get(), true, "test", type);
EXPECT_EQ(aub_stream::mode::aubFile, aubCenter.aubStreamMode);
}
MockAubCenter aubCenter2(platformDevices[0], true, "", CommandStreamReceiverType::CSR_TBX);
MockAubCenter aubCenter2(defaultHwInfo.get(), true, "", CommandStreamReceiverType::CSR_TBX);
EXPECT_EQ(aub_stream::mode::tbx, aubCenter2.aubStreamMode);
MockAubCenter aubCenter3(platformDevices[0], true, "", CommandStreamReceiverType::CSR_TBX_WITH_AUB);
MockAubCenter aubCenter3(defaultHwInfo.get(), true, "", CommandStreamReceiverType::CSR_TBX_WITH_AUB);
EXPECT_EQ(aub_stream::mode::aubFileAndTbx, aubCenter3.aubStreamMode);
}
@@ -115,12 +115,12 @@ TEST(AubCenter, GivenSetCommandStreamReceiverFlagSetWhenAubManagerIsCreatedThenD
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_TBX);
MockAubCenter aubCenter(platformDevices[0], true, "", CommandStreamReceiverType::CSR_AUB);
MockAubCenter aubCenter(defaultHwInfo.get(), true, "", CommandStreamReceiverType::CSR_AUB);
EXPECT_EQ(aub_stream::mode::tbx, aubCenter.aubStreamMode);
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_TBX_WITH_AUB);
MockAubCenter aubCenter2(platformDevices[0], true, "", CommandStreamReceiverType::CSR_AUB);
MockAubCenter aubCenter2(defaultHwInfo.get(), true, "", CommandStreamReceiverType::CSR_AUB);
EXPECT_EQ(aub_stream::mode::aubFileAndTbx, aubCenter2.aubStreamMode);
}
@@ -128,7 +128,7 @@ TEST(AubCenter, GivenAubCenterInSubCaptureModeWhenItIsCreatedWithoutDebugFilterS
DebugManagerStateRestore restorer;
DebugManager.flags.AUBDumpSubCaptureMode.set(static_cast<int32_t>(AubSubCaptureManager::SubCaptureMode::Filter));
MockAubCenter aubCenter(platformDevices[0], false, "", CommandStreamReceiverType::CSR_AUB);
MockAubCenter aubCenter(defaultHwInfo.get(), false, "", CommandStreamReceiverType::CSR_AUB);
auto subCaptureCommon = aubCenter.getSubCaptureCommon();
EXPECT_NE(nullptr, subCaptureCommon);
@@ -144,7 +144,7 @@ TEST(AubCenter, GivenAubCenterInSubCaptureModeWhenItIsCreatedWithDebugFilterSett
DebugManager.flags.AUBDumpFilterKernelEndIdx.set(100);
DebugManager.flags.AUBDumpFilterKernelName.set("kernel_name");
MockAubCenter aubCenter(platformDevices[0], false, "", CommandStreamReceiverType::CSR_AUB);
MockAubCenter aubCenter(defaultHwInfo.get(), false, "", CommandStreamReceiverType::CSR_AUB);
auto subCaptureCommon = aubCenter.getSubCaptureCommon();
EXPECT_NE(nullptr, subCaptureCommon);

View File

@@ -28,7 +28,7 @@ TEST(AubCenter, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenAubMa
DebugManagerStateRestore restorer;
DebugManager.flags.UseAubStream.set(true);
MockAubCenter aubCenter(platformDevices[0], false, "test", CommandStreamReceiverType::CSR_AUB);
MockAubCenter aubCenter(defaultHwInfo.get(), false, "test", CommandStreamReceiverType::CSR_AUB);
EXPECT_EQ(nullptr, aubCenter.aubManager.get());
}
@@ -39,7 +39,7 @@ TEST(AubCenter, GivenUseAubStreamAndTbxServerIpDebugVariableSetWhenAubCenterIsCr
DebugManager.flags.TbxServer.set("10.10.10.10");
VariableBackup<std::string> backup(&aub_stream_stubs::tbxServerIp);
MockAubCenter aubCenter(platformDevices[0], false, "", CommandStreamReceiverType::CSR_TBX);
MockAubCenter aubCenter(defaultHwInfo.get(), false, "", CommandStreamReceiverType::CSR_TBX);
EXPECT_STREQ("10.10.10.10", aub_stream_stubs::tbxServerIp.c_str());
}
@@ -54,6 +54,6 @@ TEST(AubCenter, GivenUseAubStreamAndTbxServerPortDebugVariableSetWhenAubCenterIs
uint16_t port = 1234u;
EXPECT_NE(port, aub_stream_stubs::tbxServerPort);
MockAubCenter aubCenter(platformDevices[0], false, "", CommandStreamReceiverType::CSR_TBX);
MockAubCenter aubCenter(defaultHwInfo.get(), false, "", CommandStreamReceiverType::CSR_TBX);
EXPECT_EQ(port, aub_stream_stubs::tbxServerPort);
}

View File

@@ -8,5 +8,5 @@
#include "opencl/test/unit_test/aub/aub_helper_tests.inl"
TEST(AubHelper, GivenHwInfoWhenGetMemBankSizeIsCalledThenItReturnsCorrectValue) {
EXPECT_EQ(2 * MemoryConstants::gigaByte, AubHelper::getMemBankSize(platformDevices[0]));
EXPECT_EQ(2 * MemoryConstants::gigaByte, AubHelper::getMemBankSize(defaultHwInfo.get()));
}

View File

@@ -319,7 +319,7 @@ TEST(Context, givenFtrSvmFalseWhenContextIsCreatedThenSVMAllocsManagerIsNotCreat
}
TEST(Context, whenCreateContextThenSpecialQueueUsesInternalEngine) {
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();
cl_int retVal = CL_SUCCESS;
@@ -358,7 +358,7 @@ class ContextWithAsyncDeleterTest : public ::testing::WithParamInterface<bool>,
public:
void SetUp() override {
memoryManager = new MockMemoryManager();
device = new MockClDevice{MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices)};
device = new MockClDevice{MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get())};
deleter = new MockDeferredDeleter();
device->injectMemoryManager(memoryManager);
memoryManager->setDeferredDeleter(deleter);

View File

@@ -32,7 +32,7 @@ struct Gen11CoherencyRequirements : public ::testing::Test {
}
void SetUp() override {
device.reset(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
device.reset(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
csr = new myCsr(*device->executionEnvironment);
device->resetCommandStreamReceiver(csr);
}

View File

@@ -36,7 +36,7 @@ struct Gen11MediaSamplerProgramingTest : public ::testing::Test {
}
void SetUp() override {
device.reset(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
device.reset(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
csr = new myCsr(*device->executionEnvironment);
device->resetCommandStreamReceiver(csr);

View File

@@ -42,7 +42,7 @@ struct Gen12LpCoherencyRequirements : public ::testing::Test {
}
void SetUp() override {
device.reset(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
device.reset(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
csr = new myCsr(*device->executionEnvironment);
device->resetCommandStreamReceiver(csr);
AllocationProperties properties(device->getRootDeviceIndex(), false, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SHARED_BUFFER, false);

View File

@@ -111,7 +111,7 @@ TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeForTgllpProductFa
DebugManager.flags.SetCommandStreamReceiver.set(1);
DebugManager.flags.ProductFamilyOverride.set("tgllp");
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
bool success = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);
ASSERT_TRUE(success);
@@ -129,7 +129,7 @@ TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeWhenPrepareDevice
DebugManager.flags.SetCommandStreamReceiver.set(1);
DebugManager.flags.ProductFamilyOverride.set("tgllp");
MockExecutionEnvironment executionEnvironment(*platformDevices, true, requiredDeviceCount);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get(), true, requiredDeviceCount);
bool success = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);
ASSERT_TRUE(success);

View File

@@ -160,7 +160,7 @@ TEST_F(GmmTests, GivenInvalidImageTypeWhenQueryingImgParamsThenExceptionIsThrown
}
TEST_F(GmmTests, WhenQueryingImgParamsThenCorrectValuesAreReturned) {
const HardwareInfo *hwinfo = *platformDevices;
const HardwareInfo *hwinfo = defaultHwInfo.get();
cl_image_desc imgDesc{};
imgDesc.image_type = CL_MEM_OBJECT_IMAGE3D;
imgDesc.image_width = 17;
@@ -799,7 +799,7 @@ TEST(GmmHelperTest, givenValidGmmFunctionsWhenCreateGmmHelperWithInitializedOsIn
VariableBackup<decltype(passedWaTable)> passedWaTableBackup(&passedWaTable);
VariableBackup<decltype(copyInputArgs)> copyInputArgsBackup(&copyInputArgs, true);
auto hwInfo = platformDevices[0];
auto hwInfo = defaultHwInfo.get();
SKU_FEATURE_TABLE expectedFtrTable = {};
WA_TABLE expectedWaTable = {};
SkuInfoTransfer::transferFtrTableForGmm(&expectedFtrTable, &hwInfo->featureTable);
@@ -820,7 +820,7 @@ TEST(GmmHelperTest, givenValidGmmFunctionsWhenCreateGmmHelperWithoutOsInterfaceT
VariableBackup<decltype(passedWaTable)> passedWaTableBackup(&passedWaTable);
VariableBackup<decltype(copyInputArgs)> copyInputArgsBackup(&copyInputArgs, true);
auto hwInfo = platformDevices[0];
auto hwInfo = defaultHwInfo.get();
SKU_FEATURE_TABLE expectedFtrTable = {};
WA_TABLE expectedWaTable = {};
SkuInfoTransfer::transferFtrTableForGmm(&expectedFtrTable, &hwInfo->featureTable);

View File

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

View File

@@ -52,7 +52,7 @@ bool prepareDeviceEnvironments(ExecutionEnvironment &executionEnvironment) {
if (executionEnvironment.rootDeviceEnvironments[i]->getHardwareInfo() == nullptr ||
(executionEnvironment.rootDeviceEnvironments[i]->getHardwareInfo()->platform.eProductFamily == IGFX_UNKNOWN &&
executionEnvironment.rootDeviceEnvironments[i]->getHardwareInfo()->platform.eRenderCoreFamily == IGFX_UNKNOWN_CORE)) {
executionEnvironment.rootDeviceEnvironments[i]->setHwInfo(platformDevices[0]);
executionEnvironment.rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
}
}
executionEnvironment.calculateMaxOsContextCount();

View File

@@ -49,7 +49,7 @@ class TestedMemoryManager : public OsAgnosticMemoryManager {
};
TEST(BufferTests, doPinIsSet) {
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
std::unique_ptr<TestedMemoryManager> mm(new MemoryManagerCreate<TestedMemoryManager>(false, false, executionEnvironment));
{
MockContext context;
@@ -72,7 +72,7 @@ TEST(BufferTests, doPinIsSet) {
}
}
TEST(BufferTests, doPinIsSetForHostPtr) {
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
std::unique_ptr<TestedMemoryManager> mm(new TestedMemoryManager(executionEnvironment));
{
MockContext context;

View File

@@ -2041,7 +2041,7 @@ TEST(ResidencyTests, whenBuffersIsCreatedWithMakeResidentFlagThenItSuccessfulyCr
class BufferTests : public ::testing::Test {
protected:
void SetUp() override {
device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
}
void TearDown() override {
}

View File

@@ -233,7 +233,7 @@ TEST_F(Image2dFromBufferTest, givenUnalignedImageWidthAndNoSpaceInBufferForAlign
}
TEST_F(Image2dFromBufferTest, ExtensionString) {
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
const auto hwInfo = device->getHardwareInfo();
const auto &caps = device->getDeviceInfo();
std::string extensions = caps.deviceExtensions;

View File

@@ -31,7 +31,7 @@ class ImageCompressionTests : public ::testing::Test {
};
void SetUp() override {
mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
mockDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
myMemoryManager = new MyMemoryManager(*mockDevice->getExecutionEnvironment());
mockDevice->injectMemoryManager(myMemoryManager);
mockContext = make_releaseable<MockContext>(mockDevice.get());

View File

@@ -144,7 +144,7 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag
cl_image_format imageFormat;
cl_image_desc imageDesc;
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
const auto &caps = device->getDeviceInfo();
const auto &sharedCaps = device->getSharedDeviceInfo();

View File

@@ -48,7 +48,7 @@ class MyMockCommandQueue : public CommandQueueHw<Family> {
class ImageUnmapTest : public ::testing::Test {
public:
void SetUp() override {
device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
context = std::make_unique<MockContext>(device.get());
image.reset(ImageHelper<ImageReadOnly<Image3dDefaults>>::create(context.get()));
}

View File

@@ -19,7 +19,7 @@ class ImageHostPtrTransferTests : public testing::Test {
public:
void SetUp() override {
device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
context.reset(new MockContext(device.get()));
}

View File

@@ -35,7 +35,7 @@ TEST(DrmMemoryManagerTest, givenDrmMemoryManagerWhenSharedAllocationIsCreatedFro
return 0;
}
};
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
auto mock = new MockDrm(0, *executionEnvironment.rootDeviceEnvironments[0]);
executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setDrm(mock);
@@ -100,7 +100,7 @@ TEST(DrmMemoryManagerTest, givenMultipleThreadsWhenSharedAllocationIsCreatedThen
}
};
MockExecutionEnvironment executionEnvironment(*platformDevices);
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique<OSInterface>();
auto mock = new MockDrm(0, *executionEnvironment.rootDeviceEnvironments[0]);
executionEnvironment.rootDeviceEnvironments[0]->osInterface->get()->setDrm(mock);

View File

@@ -19,7 +19,7 @@ void NEO::UltConfigListener::OnTestStart(const ::testing::TestInfo &testInfo) {
referencedHwInfo = *defaultHwInfo;
auto executionEnvironment = constructPlatform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(*platformDevices);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
executionEnvironment->calculateMaxOsContextCount();
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
}
@@ -32,5 +32,5 @@ void NEO::UltConfigListener::OnTestEnd(const ::testing::TestInfo &testInfo) {
UltHwConfig expectedState{};
static_assert(sizeof(UltHwConfig) == 7 * sizeof(bool), ""); // Ensure that there is no internal padding
EXPECT_EQ(0, memcmp(&expectedState, &ultHwConfig, sizeof(UltHwConfig)));
EXPECT_EQ(0, memcmp(&referencedHwInfo, platformDevices[0], sizeof(HardwareInfo)));
EXPECT_EQ(0, memcmp(&referencedHwInfo, defaultHwInfo.get(), sizeof(HardwareInfo)));
}