2019-10-22 17:44:06 +08:00
|
|
|
/*
|
2021-01-18 16:27:50 +08:00
|
|
|
* Copyright (C) 2019-2021 Intel Corporation
|
2019-10-22 17:44:06 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2021-04-16 20:52:30 +08:00
|
|
|
#include "shared/source/built_ins/sip_kernel_type.h"
|
2021-05-05 16:07:53 +08:00
|
|
|
#include "shared/source/helpers/affinity_mask.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/options.h"
|
2019-11-15 16:59:48 +08:00
|
|
|
|
|
|
|
#include <cstdint>
|
2019-11-05 20:38:20 +08:00
|
|
|
#include <memory>
|
2020-02-27 22:32:57 +08:00
|
|
|
#include <mutex>
|
2019-11-15 16:59:48 +08:00
|
|
|
#include <string>
|
2019-10-22 17:44:06 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
2020-03-11 15:56:55 +08:00
|
|
|
class AubCenter;
|
2021-01-27 21:31:29 +08:00
|
|
|
class BindlessHeapsHelper;
|
2020-02-27 22:32:57 +08:00
|
|
|
class BuiltIns;
|
|
|
|
class CompilerInterface;
|
2020-03-11 15:56:55 +08:00
|
|
|
class Debugger;
|
|
|
|
class ExecutionEnvironment;
|
2020-02-25 01:04:30 +08:00
|
|
|
class GmmClientContext;
|
|
|
|
class GmmHelper;
|
2019-11-07 01:14:30 +08:00
|
|
|
class GmmPageTableMngr;
|
2020-03-11 15:56:55 +08:00
|
|
|
class HwDeviceId;
|
2021-01-27 21:31:29 +08:00
|
|
|
class MemoryManager;
|
2019-11-28 20:02:11 +08:00
|
|
|
class MemoryOperationsHandler;
|
2020-01-07 14:42:40 +08:00
|
|
|
class OSInterface;
|
2021-04-16 20:52:30 +08:00
|
|
|
class SipKernel;
|
2021-01-26 19:22:10 +08:00
|
|
|
class SWTagsManager;
|
2020-01-30 22:04:19 +08:00
|
|
|
struct HardwareInfo;
|
2019-10-24 19:34:25 +08:00
|
|
|
|
2019-10-22 17:44:06 +08:00
|
|
|
struct RootDeviceEnvironment {
|
2020-03-04 15:51:02 +08:00
|
|
|
protected:
|
|
|
|
std::unique_ptr<HardwareInfo> hwInfo;
|
|
|
|
|
|
|
|
public:
|
2019-11-15 16:59:48 +08:00
|
|
|
RootDeviceEnvironment(ExecutionEnvironment &executionEnvironment);
|
2019-10-24 19:34:25 +08:00
|
|
|
RootDeviceEnvironment(RootDeviceEnvironment &) = delete;
|
2019-11-15 16:59:48 +08:00
|
|
|
MOCKABLE_VIRTUAL ~RootDeviceEnvironment();
|
2020-03-04 15:51:02 +08:00
|
|
|
|
2020-02-18 23:02:26 +08:00
|
|
|
MOCKABLE_VIRTUAL const HardwareInfo *getHardwareInfo() const;
|
2020-03-04 15:51:02 +08:00
|
|
|
HardwareInfo *getMutableHardwareInfo() const;
|
|
|
|
void setHwInfo(const HardwareInfo *hwInfo);
|
|
|
|
bool isFullRangeSvm() const;
|
2019-11-15 16:59:48 +08:00
|
|
|
|
|
|
|
MOCKABLE_VIRTUAL void initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType);
|
2020-09-10 18:36:44 +08:00
|
|
|
bool initOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex);
|
2020-02-25 23:38:47 +08:00
|
|
|
void initGmm();
|
2020-03-11 15:56:55 +08:00
|
|
|
void initDebugger();
|
2021-07-21 16:47:43 +08:00
|
|
|
MOCKABLE_VIRTUAL bool initAilConfiguration();
|
2020-02-25 01:04:30 +08:00
|
|
|
GmmHelper *getGmmHelper() const;
|
|
|
|
GmmClientContext *getGmmClientContext() const;
|
2020-02-27 22:32:57 +08:00
|
|
|
MOCKABLE_VIRTUAL CompilerInterface *getCompilerInterface();
|
|
|
|
BuiltIns *getBuiltIns();
|
2021-01-27 21:31:29 +08:00
|
|
|
BindlessHeapsHelper *getBindlessHeapsHelper() const;
|
|
|
|
void createBindlessHeapsHelper(MemoryManager *memoryManager, bool availableDevices, uint32_t rootDeviceIndex);
|
2019-11-15 16:59:48 +08:00
|
|
|
|
2021-04-16 20:52:30 +08:00
|
|
|
std::unique_ptr<SipKernel> sipKernels[static_cast<uint32_t>(SipKernelType::COUNT)];
|
2020-02-25 23:38:47 +08:00
|
|
|
std::unique_ptr<GmmHelper> gmmHelper;
|
2020-01-07 14:42:40 +08:00
|
|
|
std::unique_ptr<OSInterface> osInterface;
|
2019-11-07 01:14:30 +08:00
|
|
|
std::unique_ptr<GmmPageTableMngr> pageTableManager;
|
2019-11-28 20:02:11 +08:00
|
|
|
std::unique_ptr<MemoryOperationsHandler> memoryOperationsInterface;
|
2019-10-24 19:34:25 +08:00
|
|
|
std::unique_ptr<AubCenter> aubCenter;
|
2021-01-27 21:31:29 +08:00
|
|
|
std::unique_ptr<BindlessHeapsHelper> bindlessHeapsHelper;
|
2020-02-27 22:32:57 +08:00
|
|
|
|
|
|
|
std::unique_ptr<CompilerInterface> compilerInterface;
|
2020-03-11 15:56:55 +08:00
|
|
|
std::unique_ptr<BuiltIns> builtins;
|
|
|
|
std::unique_ptr<Debugger> debugger;
|
2021-01-26 19:22:10 +08:00
|
|
|
std::unique_ptr<SWTagsManager> tagsManager;
|
2019-11-15 16:59:48 +08:00
|
|
|
ExecutionEnvironment &executionEnvironment;
|
2020-02-27 22:32:57 +08:00
|
|
|
|
2021-05-05 16:07:53 +08:00
|
|
|
AffinityMaskHelper deviceAffinityMask{true};
|
2021-01-25 17:24:00 +08:00
|
|
|
|
2020-02-27 22:32:57 +08:00
|
|
|
private:
|
|
|
|
std::mutex mtx;
|
2019-10-22 17:44:06 +08:00
|
|
|
};
|
|
|
|
} // namespace NEO
|