2018-06-22 12:54:33 +02:00
|
|
|
/*
|
2019-01-10 13:57:40 +01:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
2018-09-18 09:11:08 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2018-06-27 11:35:37 +02:00
|
|
|
#pragma once
|
2019-10-22 11:44:06 +02:00
|
|
|
#include "core/execution_environment/root_device_environment.h"
|
2019-09-11 09:26:24 +02:00
|
|
|
#include "core/utilities/reference_tracked_object.h"
|
2019-02-08 15:08:35 +01:00
|
|
|
#include "runtime/helpers/options.h"
|
2018-07-12 11:45:02 +02:00
|
|
|
#include "runtime/os_interface/device_factory.h"
|
2018-06-22 12:54:33 +02:00
|
|
|
|
2018-08-01 09:06:46 +02:00
|
|
|
#include <mutex>
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2019-02-26 17:52:31 +01:00
|
|
|
class BuiltIns;
|
2018-07-11 14:16:35 +02:00
|
|
|
class CommandStreamReceiver;
|
2019-02-26 17:52:31 +01:00
|
|
|
class CompilerInterface;
|
|
|
|
|
class GmmHelper;
|
2018-07-11 16:47:49 +02:00
|
|
|
class MemoryManager;
|
2019-10-22 11:44:06 +02:00
|
|
|
class MemoryOperationsHandler;
|
2018-08-10 11:07:17 +02:00
|
|
|
class OSInterface;
|
2019-10-07 12:42:28 +02:00
|
|
|
class RootDevice;
|
2019-10-22 11:44:06 +02:00
|
|
|
class SourceLevelDebugger;
|
2019-02-26 17:52:31 +01:00
|
|
|
struct HardwareInfo;
|
2018-08-21 15:47:21 +02:00
|
|
|
|
2018-06-22 12:54:33 +02:00
|
|
|
class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment> {
|
2018-07-12 11:45:02 +02:00
|
|
|
private:
|
2018-08-01 09:06:46 +02:00
|
|
|
std::mutex mtx;
|
2018-07-12 11:45:02 +02:00
|
|
|
DeviceFactoryCleaner cleaner;
|
|
|
|
|
|
2018-07-13 07:42:18 +02:00
|
|
|
protected:
|
|
|
|
|
std::unique_ptr<GmmHelper> gmmHelper;
|
2019-05-06 12:33:44 +02:00
|
|
|
std::unique_ptr<HardwareInfo> hwInfo;
|
2018-07-13 07:42:18 +02:00
|
|
|
|
2018-06-27 11:35:37 +02:00
|
|
|
public:
|
2018-07-03 10:00:12 +02:00
|
|
|
ExecutionEnvironment();
|
2018-06-27 11:35:37 +02:00
|
|
|
~ExecutionEnvironment() override;
|
2018-07-23 12:23:48 +02:00
|
|
|
|
2019-01-23 11:59:54 +01:00
|
|
|
MOCKABLE_VIRTUAL void initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType);
|
|
|
|
|
void initGmm();
|
2019-10-24 13:34:25 +02:00
|
|
|
bool initializeCommandStreamReceiver(uint32_t rootDeviceIndex, uint32_t internalDeviceIndex, uint32_t deviceCsrIndex);
|
2019-10-07 12:42:28 +02:00
|
|
|
MOCKABLE_VIRTUAL bool initializeRootCommandStreamReceiver(RootDevice &rootDevice);
|
2019-03-15 10:22:35 +01:00
|
|
|
void initializeMemoryManager();
|
2019-01-23 11:59:54 +01:00
|
|
|
void initSourceLevelDebugger();
|
|
|
|
|
void setHwInfo(const HardwareInfo *hwInfo);
|
2019-05-06 12:33:44 +02:00
|
|
|
const HardwareInfo *getHardwareInfo() const { return hwInfo.get(); }
|
|
|
|
|
HardwareInfo *getMutableHardwareInfo() const { return hwInfo.get(); }
|
2019-09-03 14:20:32 +02:00
|
|
|
bool isFullRangeSvm() const;
|
2018-07-23 12:23:48 +02:00
|
|
|
|
|
|
|
|
GmmHelper *getGmmHelper() const;
|
2018-08-01 09:06:46 +02:00
|
|
|
MOCKABLE_VIRTUAL CompilerInterface *getCompilerInterface();
|
2018-08-21 15:47:21 +02:00
|
|
|
BuiltIns *getBuiltIns();
|
2018-07-23 12:23:48 +02:00
|
|
|
|
2018-08-10 11:07:17 +02:00
|
|
|
std::unique_ptr<OSInterface> osInterface;
|
2019-08-21 10:53:07 +02:00
|
|
|
std::unique_ptr<MemoryOperationsHandler> memoryOperationsInterface;
|
2018-07-11 16:47:49 +02:00
|
|
|
std::unique_ptr<MemoryManager> memoryManager;
|
2019-10-24 13:34:25 +02:00
|
|
|
std::vector<RootDeviceEnvironment> rootDeviceEnvironments{1};
|
2018-08-21 15:47:21 +02:00
|
|
|
std::unique_ptr<BuiltIns> builtins;
|
2018-08-01 09:06:46 +02:00
|
|
|
std::unique_ptr<CompilerInterface> compilerInterface;
|
2018-07-12 15:47:48 +02:00
|
|
|
std::unique_ptr<SourceLevelDebugger> sourceLevelDebugger;
|
2018-06-22 12:54:33 +02:00
|
|
|
};
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|