/* * Copyright (C) 2019-2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once #include "shared/source/helpers/options.h" #include #include #include #include namespace NEO { class AubCenter; class BindlessHeapsHelper; class BuiltIns; class CompilerInterface; class Debugger; class ExecutionEnvironment; class GmmClientContext; class GmmHelper; class GmmPageTableMngr; class HwDeviceId; class MemoryManager; class MemoryOperationsHandler; class OSInterface; struct HardwareInfo; constexpr uint32_t allSubDevicesActive = std::numeric_limits::max(); struct RootDeviceEnvironment { protected: std::unique_ptr hwInfo; public: RootDeviceEnvironment(ExecutionEnvironment &executionEnvironment); RootDeviceEnvironment(RootDeviceEnvironment &) = delete; MOCKABLE_VIRTUAL ~RootDeviceEnvironment(); MOCKABLE_VIRTUAL const HardwareInfo *getHardwareInfo() const; HardwareInfo *getMutableHardwareInfo() const; void setHwInfo(const HardwareInfo *hwInfo); bool isFullRangeSvm() const; MOCKABLE_VIRTUAL void initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType); bool initOsInterface(std::unique_ptr &&hwDeviceId, uint32_t rootDeviceIndex); void initGmm(); void initDebugger(); GmmHelper *getGmmHelper() const; GmmClientContext *getGmmClientContext() const; MOCKABLE_VIRTUAL CompilerInterface *getCompilerInterface(); BuiltIns *getBuiltIns(); BindlessHeapsHelper *getBindlessHeapsHelper() const; void createBindlessHeapsHelper(MemoryManager *memoryManager, bool availableDevices, uint32_t rootDeviceIndex); std::unique_ptr gmmHelper; std::unique_ptr osInterface; std::unique_ptr pageTableManager; std::unique_ptr memoryOperationsInterface; std::unique_ptr aubCenter; std::unique_ptr bindlessHeapsHelper; std::unique_ptr compilerInterface; std::unique_ptr builtins; std::unique_ptr debugger; ExecutionEnvironment &executionEnvironment; uint32_t deviceAffinityMask = allSubDevicesActive; private: std::mutex mtx; }; } // namespace NEO