diff --git a/unit_tests/mock_gmm/mock_gmm.cpp b/unit_tests/mock_gmm/mock_gmm.cpp index 3f15be7ce5..9c9b2b4f97 100644 --- a/unit_tests/mock_gmm/mock_gmm.cpp +++ b/unit_tests/mock_gmm/mock_gmm.cpp @@ -19,6 +19,11 @@ GMM_STATUS GMM_STDCALL createSingletonContext(const PLATFORM Platform, const SKU_FEATURE_TABLE *featureTable, const WA_TABLE *workaroundTable, const GT_SYSTEM_INFO *pGtSysInfo) { + if (Platform.eProductFamily == PRODUCT_FAMILY::IGFX_UNKNOWN && + Platform.eRenderCoreFamily == GFXCORE_FAMILY::IGFX_UNKNOWN_CORE && + Platform.ePCHProductFamily == PCH_PRODUCT_FAMILY::PCH_UNKNOWN) { + return GMM_ERROR; + } return GMM_SUCCESS; } #else diff --git a/unit_tests/windows/get_devices_tests.cpp b/unit_tests/windows/get_devices_tests.cpp index c145ce4bda..d1837d64d2 100644 --- a/unit_tests/windows/get_devices_tests.cpp +++ b/unit_tests/windows/get_devices_tests.cpp @@ -7,18 +7,31 @@ #include "runtime/execution_environment/execution_environment.h" #include "runtime/helpers/hw_info.h" +#include "runtime/os_interface/device_factory.h" +#include "runtime/platform/platform.h" #include "test.h" -namespace NEO { -bool getDevices(size_t &numDevicesReturned, ExecutionEnvironment &executionEnvironment); -} // namespace NEO +using namespace NEO; using GetDevicesTests = ::testing::Test; HWTEST_F(GetDevicesTests, WhenGetDevicesIsCalledThenSuccessIsReturned) { size_t numDevicesReturned = 0; - NEO::ExecutionEnvironment executionEnviornment; + ExecutionEnvironment executionEnviornment; - auto returnValue = NEO::getDevices(numDevicesReturned, executionEnviornment); + auto returnValue = DeviceFactory::getDevices(numDevicesReturned, executionEnviornment); EXPECT_EQ(true, returnValue); } + +HWTEST_F(GetDevicesTests, whenGetDevicesIsCalledThenGmmIsBeingInitializedAfterFillingHwInfo) { + platformImpl.reset(new Platform()); + size_t numDevicesReturned = 0; + HardwareInfo hwInfo; + hwInfo.platform.eProductFamily = PRODUCT_FAMILY::IGFX_UNKNOWN; + hwInfo.platform.eRenderCoreFamily = GFXCORE_FAMILY::IGFX_UNKNOWN_CORE; + hwInfo.platform.ePCHProductFamily = PCH_PRODUCT_FAMILY::PCH_UNKNOWN; + platform()->peekExecutionEnvironment()->setHwInfo(&hwInfo); + + auto returnValue = DeviceFactory::getDevices(numDevicesReturned, *platform()->peekExecutionEnvironment()); + EXPECT_TRUE(returnValue); +}