Files
compute-runtime/opencl/test/unit_test/helpers/execution_environment_helper.cpp
Pawel Cieslak 8a700c5187 Move non-ult shared files to single directory
Add SKIP_SHARED_UNIT_TESTS flag

Related-To: NEO-5201
Signed-off-by: Pawel Cieslak <pawel.cieslak@intel.com>
2021-02-10 21:03:13 +01:00

32 lines
1.1 KiB
C++

/*
* Copyright (C) 2018-2021 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/common/helpers/debug_manager_state_restore.h"
#include "opencl/source/platform/platform.h"
#include "opencl/test/unit_test/mocks/mock_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);
hwInfo = nullptr;
DeviceFactory::prepareDeviceEnvironments(*executionEnvironment);
hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
executionEnvironment->initializeMemoryManager();
return executionEnvironment;
}
} // namespace NEO