Files
compute-runtime/unit_tests/helpers/execution_environment_helper.cpp
Jobczyk, Lukasz 44a9ec5c1a Make MemoryOperationsHandler adapter specific
Change-Id: I978ecaf0fbe3cfc3b645b84d978b7d9234b28bd1
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
2019-12-30 19:26:19 +01:00

30 lines
1021 B
C++

/*
* Copyright (C) 2018-2019 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 = platformImpl->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