2019-03-01 21:58:11 +08:00
|
|
|
/*
|
2020-02-03 23:18:21 +08:00
|
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
2019-03-01 21:58:11 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-05 15:30:17 +08:00
|
|
|
#include "core/execution_environment/execution_environment.h"
|
2019-11-29 22:41:47 +08:00
|
|
|
#include "core/helpers/hw_info.h"
|
2020-02-05 18:49:26 +08:00
|
|
|
#include "core/os_interface/device_factory.h"
|
2019-03-01 21:58:11 +08:00
|
|
|
#include "test.h"
|
|
|
|
|
2020-02-22 16:28:27 +08:00
|
|
|
#include "platform/platform.h"
|
|
|
|
|
2019-07-16 19:45:35 +08:00
|
|
|
using namespace NEO;
|
2019-03-01 21:58:11 +08:00
|
|
|
|
|
|
|
using GetDevicesTests = ::testing::Test;
|
|
|
|
|
|
|
|
HWTEST_F(GetDevicesTests, WhenGetDevicesIsCalledThenSuccessIsReturned) {
|
|
|
|
size_t numDevicesReturned = 0;
|
2019-07-25 23:59:12 +08:00
|
|
|
ExecutionEnvironment executionEnvironment;
|
2019-03-01 21:58:11 +08:00
|
|
|
|
2019-07-25 23:59:12 +08:00
|
|
|
auto returnValue = DeviceFactory::getDevices(numDevicesReturned, executionEnvironment);
|
2019-03-01 21:58:11 +08:00
|
|
|
EXPECT_EQ(true, returnValue);
|
|
|
|
}
|
2019-07-16 19:45:35 +08:00
|
|
|
|
|
|
|
HWTEST_F(GetDevicesTests, whenGetDevicesIsCalledThenGmmIsBeingInitializedAfterFillingHwInfo) {
|
2020-02-03 23:18:21 +08:00
|
|
|
platformsImpl.clear();
|
2020-02-07 19:15:46 +08:00
|
|
|
auto executionEnvironment = new ExecutionEnvironment();
|
|
|
|
platformsImpl.push_back(std::make_unique<Platform>(*executionEnvironment));
|
2019-07-16 19:45:35 +08:00
|
|
|
size_t numDevicesReturned = 0;
|
2020-02-07 19:15:46 +08:00
|
|
|
auto hwInfo = executionEnvironment->getMutableHardwareInfo();
|
2019-12-17 15:11:16 +08:00
|
|
|
hwInfo->platform.eProductFamily = PRODUCT_FAMILY::IGFX_UNKNOWN;
|
|
|
|
hwInfo->platform.ePCHProductFamily = PCH_PRODUCT_FAMILY::PCH_UNKNOWN;
|
2019-07-16 19:45:35 +08:00
|
|
|
|
2020-02-07 19:15:46 +08:00
|
|
|
auto returnValue = DeviceFactory::getDevices(numDevicesReturned, *executionEnvironment);
|
2019-07-16 19:45:35 +08:00
|
|
|
EXPECT_TRUE(returnValue);
|
|
|
|
}
|