/* * Copyright (C) 2018-2019 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once #include "runtime/helpers/hw_info.h" #include "runtime/helpers/options.h" #include "runtime/memory_manager/memory_constants.h" #include "runtime/os_interface/device_factory.h" #include "runtime/utilities/reference_tracked_object.h" #include "engine_node.h" #include #include namespace NEO { class AubCenter; class BuiltIns; class CommandStreamReceiver; class CompilerInterface; class GmmHelper; class MemoryManager; class SourceLevelDebugger; class OSInterface; struct EngineControl; struct HardwareInfo; using CsrContainer = std::vector>>; class ExecutionEnvironment : public ReferenceTrackedObject { private: std::mutex mtx; DeviceFactoryCleaner cleaner; protected: std::unique_ptr gmmHelper; std::unique_ptr hwInfo; public: ExecutionEnvironment(); ~ExecutionEnvironment() override; MOCKABLE_VIRTUAL void initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType); void initGmm(); bool initializeCommandStreamReceiver(uint32_t deviceIndex, uint32_t deviceCsrIndex); void initializeSpecialCommandStreamReceiver(); void initializeMemoryManager(); void initSourceLevelDebugger(); void setHwInfo(const HardwareInfo *hwInfo); const HardwareInfo *getHardwareInfo() const { return hwInfo.get(); } HardwareInfo *getMutableHardwareInfo() const { return hwInfo.get(); } bool isFullRangeSvm() const { return hwInfo->capabilityTable.gpuAddressSpace == MemoryConstants::max48BitAddress; } GmmHelper *getGmmHelper() const; MOCKABLE_VIRTUAL CompilerInterface *getCompilerInterface(); BuiltIns *getBuiltIns(); EngineControl *getEngineControlForSpecialCsr(); std::unique_ptr osInterface; std::unique_ptr memoryManager; std::unique_ptr aubCenter; CsrContainer commandStreamReceivers; std::unique_ptr specialCommandStreamReceiver; std::unique_ptr builtins; std::unique_ptr compilerInterface; std::unique_ptr sourceLevelDebugger; }; } // namespace NEO