Files
compute-runtime/opencl/test/unit_test/helpers/execution_environment_helper.cpp
Lukasz Jobczyk e9c576393e Move hwInfo to root device environment
Related-To: NEO-3857

Change-Id: Ic23077cad080a249457cec39462ca7407e75b227
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2020-03-10 17:13:08 +01:00

32 lines
1.1 KiB
C++

/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/test/unit_test/helpers/execution_environment_helper.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/device_factory.h"
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
#include "opencl/source/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->rootDeviceEnvironments[0]->getMutableHardwareInfo();
executionEnvironment->initializeMemoryManager();
return executionEnvironment;
}
} // namespace NEO