mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Add member for handling additional adapterInfo fields
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
d8cd596baf
commit
b39be32e20
@ -7,7 +7,9 @@
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/helpers/get_info.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/ult_hw_config.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/unit_test/helpers/gtest_helpers.h"
|
||||
|
||||
@ -21,10 +23,14 @@ using namespace ::testing;
|
||||
namespace NEO {
|
||||
|
||||
TEST(DeviceOsTest, GivenDefaultClDeviceWhenCheckingForOsSpecificExtensionsThenCorrectExtensionsAreSet) {
|
||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||
DebugManagerStateRestore stateRestore;
|
||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||
|
||||
auto hwInfo = defaultHwInfo.get();
|
||||
auto pDevice = MockDevice::createWithNewExecutionEnvironment<Device>(hwInfo);
|
||||
DeviceFactory::prepareDeviceEnvironments(*pDevice->getExecutionEnvironment());
|
||||
auto pClDevice = new ClDevice{*pDevice, platform()};
|
||||
|
||||
std::string extensionString(pClDevice->getDeviceInfo().deviceExtensions);
|
||||
|
||||
EXPECT_FALSE(hasSubstr(extensionString, std::string("cl_intel_va_api_media_sharing ")));
|
||||
|
@ -177,29 +177,11 @@ TEST_F(DriverInfoWindowsTest, GivenDriverInfoWhenThenReturnNonNullptr) {
|
||||
EXPECT_TRUE(registryReaderMock->properVersionKey);
|
||||
};
|
||||
|
||||
TEST(DriverInfo, givenDriverInfoWhenGetStringReturnNotMeaningEmptyStringThenEnableSharingSupport) {
|
||||
TEST(DriverInfo, givenDriverInfoWhenGetMediaSharingSupportThenTrueIsReturned) {
|
||||
MockDriverInfoWindows driverInfo("", PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue));
|
||||
MockRegistryReader *registryReaderMock = new MockRegistryReader();
|
||||
|
||||
driverInfo.registryReader.reset(registryReaderMock);
|
||||
auto enable = driverInfo.getMediaSharingSupport();
|
||||
|
||||
EXPECT_TRUE(enable);
|
||||
EXPECT_EQ(is64bit, registryReaderMock->using64bit);
|
||||
EXPECT_TRUE(registryReaderMock->properMediaSharingExtensions);
|
||||
};
|
||||
|
||||
TEST(DriverInfo, givenDriverInfoWhenGetStringReturnMeaningEmptyStringThenDisableSharingSupport) {
|
||||
MockDriverInfoWindows driverInfo("", PhysicalDevicePciBusInfo(PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue, PhysicalDevicePciBusInfo::invalidValue));
|
||||
MockRegistryReader *registryReaderMock = new MockRegistryReader();
|
||||
registryReaderMock->returnString = "<>";
|
||||
driverInfo.registryReader.reset(registryReaderMock);
|
||||
|
||||
auto enable = driverInfo.getMediaSharingSupport();
|
||||
|
||||
EXPECT_FALSE(enable);
|
||||
EXPECT_EQ(is64bit, registryReaderMock->using64bit);
|
||||
EXPECT_TRUE(registryReaderMock->properMediaSharingExtensions);
|
||||
};
|
||||
|
||||
TEST(DriverInfo, givenFullPathToRegistryWhenCreatingDriverInfoWindowsThenTheRegistryPathIsTrimmed) {
|
||||
@ -262,16 +244,4 @@ TEST_F(DriverInfoWindowsTest, whenCurrentLibraryIsLoadedFromDifferentDriverStore
|
||||
EXPECT_FALSE(driverInfo->isCompatibleDriverStore());
|
||||
}
|
||||
|
||||
TEST_F(DriverInfoWindowsTest, givenDriverInfoWindowsWhenGetImageSupportIsCalledThenReturnTrue) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment);
|
||||
std::unique_ptr<OSInterface> osInterface(new OSInterface());
|
||||
osInterface->setDriverModel(std::unique_ptr<DriverModel>(Wddm::createWddm(nullptr, rootDeviceEnvironment)));
|
||||
EXPECT_NE(nullptr, osInterface->getDriverModel()->as<Wddm>());
|
||||
|
||||
std::unique_ptr<DriverInfo> driverInfo(DriverInfo::create(nullptr, osInterface.get()));
|
||||
|
||||
EXPECT_TRUE(driverInfo->getImageSupport());
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
Reference in New Issue
Block a user