Files
compute-runtime/unit_tests/windows/get_devices_tests.cpp
Maciej Plewka 0e2dad1ffb Move device factory to core
Change-Id: Ic98a75ed80fb9556465c9a6c93b1b1a9ba628200
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2020-02-05 16:34:14 +01:00

37 lines
1.2 KiB
C++

/*
* Copyright (C) 2019-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "core/helpers/hw_info.h"
#include "core/os_interface/device_factory.h"
#include "runtime/execution_environment/execution_environment.h"
#include "runtime/platform/platform.h"
#include "test.h"
using namespace NEO;
using GetDevicesTests = ::testing::Test;
HWTEST_F(GetDevicesTests, WhenGetDevicesIsCalledThenSuccessIsReturned) {
size_t numDevicesReturned = 0;
ExecutionEnvironment executionEnvironment;
auto returnValue = DeviceFactory::getDevices(numDevicesReturned, executionEnvironment);
EXPECT_EQ(true, returnValue);
}
HWTEST_F(GetDevicesTests, whenGetDevicesIsCalledThenGmmIsBeingInitializedAfterFillingHwInfo) {
platformsImpl.clear();
platformsImpl.push_back(std::make_unique<Platform>());
size_t numDevicesReturned = 0;
auto hwInfo = platform()->peekExecutionEnvironment()->getMutableHardwareInfo();
hwInfo->platform.eProductFamily = PRODUCT_FAMILY::IGFX_UNKNOWN;
hwInfo->platform.ePCHProductFamily = PCH_PRODUCT_FAMILY::PCH_UNKNOWN;
auto returnValue = DeviceFactory::getDevices(numDevicesReturned, *platform()->peekExecutionEnvironment());
EXPECT_TRUE(returnValue);
}