2018-09-17 21:42:15 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
2018-09-17 21:42:15 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "unit_tests/helpers/execution_environment_helper.h"
|
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "runtime/os_interface/device_factory.h"
|
2019-01-23 18:59:54 +08:00
|
|
|
#include "runtime/platform/platform.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-09-17 21:42:15 +08:00
|
|
|
|
|
|
|
ExecutionEnvironment *getExecutionEnvironmentImpl(HardwareInfo *&hwInfo) {
|
2019-01-23 18:59:54 +08:00
|
|
|
ExecutionEnvironment *executionEnvironment = platformImpl->peekExecutionEnvironment();
|
2018-09-17 21:42:15 +08:00
|
|
|
size_t numDevicesReturned = 0;
|
|
|
|
hwInfo = nullptr;
|
|
|
|
DeviceFactory::getDevices(&hwInfo, numDevicesReturned, *executionEnvironment);
|
2019-03-15 17:22:35 +08:00
|
|
|
executionEnvironment->initializeMemoryManager();
|
2019-03-08 19:18:02 +08:00
|
|
|
|
2018-09-17 21:42:15 +08:00
|
|
|
return executionEnvironment;
|
|
|
|
}
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|