Files
compute-runtime/opencl/test/unit_test/helpers/execution_environment_helper.cpp
Mateusz Jablonski 370424a1e0 Change core inlcudes
Change-Id: Iaec903af420f0a92f7d86e484c83300fb9c531ad
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2020-02-23 18:46:50 +01:00

30 lines
1023 B
C++

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