2018-06-22 12:54:33 +02:00
|
|
|
/*
|
2020-01-07 07:42:40 +01:00
|
|
|
* Copyright (C) 2018-2020 Intel Corporation
|
2018-09-18 09:11:08 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2018-06-27 11:35:37 +02:00
|
|
|
#pragma once
|
2020-02-23 18:46:50 +01:00
|
|
|
#include "os_interface/device_factory.h"
|
|
|
|
|
#include "utilities/reference_tracked_object.h"
|
2018-06-22 12:54:33 +02:00
|
|
|
|
2018-08-01 09:06:46 +02:00
|
|
|
#include <mutex>
|
2019-11-05 13:38:20 +01:00
|
|
|
#include <vector>
|
2018-08-01 09:06:46 +02:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2019-02-26 17:52:31 +01:00
|
|
|
class BuiltIns;
|
|
|
|
|
class CompilerInterface;
|
2019-12-30 14:14:27 +01:00
|
|
|
class GmmClientContext;
|
2019-02-26 17:52:31 +01:00
|
|
|
class GmmHelper;
|
2018-07-11 16:47:49 +02:00
|
|
|
class MemoryManager;
|
2020-02-10 15:57:49 +01:00
|
|
|
class Debugger;
|
2019-11-15 09:59:48 +01:00
|
|
|
struct RootDeviceEnvironment;
|
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
|
|
|
|
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
|
|
|
void initGmm();
|
2019-03-15 10:22:35 +01:00
|
|
|
void initializeMemoryManager();
|
2020-02-10 15:57:49 +01:00
|
|
|
void initDebugger();
|
2019-12-17 08:11:16 +01:00
|
|
|
void calculateMaxOsContextCount();
|
2019-01-23 11:59:54 +01:00
|
|
|
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;
|
2019-11-15 09:59:48 +01:00
|
|
|
void prepareRootDeviceEnvironments(uint32_t numRootDevices);
|
2018-07-23 12:23:48 +02:00
|
|
|
|
|
|
|
|
GmmHelper *getGmmHelper() const;
|
2019-12-30 14:14:27 +01:00
|
|
|
GmmClientContext *getGmmClientContext() 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-07-11 16:47:49 +02:00
|
|
|
std::unique_ptr<MemoryManager> memoryManager;
|
2019-11-15 09:59:48 +01:00
|
|
|
std::vector<std::unique_ptr<RootDeviceEnvironment>> rootDeviceEnvironments;
|
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;
|
2020-02-10 15:57:49 +01:00
|
|
|
std::unique_ptr<Debugger> debugger;
|
2018-06-22 12:54:33 +02:00
|
|
|
};
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|