Files
compute-runtime/unit_tests/helpers/execution_environment_helper.cpp
Mateusz Jablonski e77ed5f4fa Make platformImpl a vector
Related-To: NEO-4207
Change-Id: I85fa2d5a44160e1cf98321f9835a5173e59e479c
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2020-02-04 15:29:19 +01:00

30 lines
1019 B
C++

/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "unit_tests/helpers/execution_environment_helper.h"
#include "core/unit_tests/helpers/debug_manager_state_restore.h"
#include "runtime/os_interface/device_factory.h"
#include "runtime/platform/platform.h"
namespace NEO {
ExecutionEnvironment *getExecutionEnvironmentImpl(HardwareInfo *&hwInfo, uint32_t rootDeviceEnvironments) {
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->prepareRootDeviceEnvironments(rootDeviceEnvironments);
DebugManagerStateRestore restorer;
DebugManager.flags.CreateMultipleRootDevices.set(rootDeviceEnvironments);
size_t numDevicesReturned = 0;
hwInfo = nullptr;
DeviceFactory::getDevices(numDevicesReturned, *executionEnvironment);
hwInfo = executionEnvironment->getMutableHardwareInfo();
executionEnvironment->initializeMemoryManager();
return executionEnvironment;
}
} // namespace NEO