Add test that ensures gmm is being initialized with proper HwInfo

Related-To: NEO-3331

Change-Id: If7f463a065d5d10a22a550c46cb05f3f7a322b0d
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
Jobczyk, Lukasz
2019-07-16 13:45:35 +02:00
committed by sys_ocldev
parent 023819ee0b
commit dfd361dc74
2 changed files with 23 additions and 5 deletions

View File

@@ -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);
}