/* * Copyright (C) 2018-2019 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once #include "engine_node.h" #include "runtime/helpers/options.h" #include "runtime/os_interface/device_factory.h" #include "runtime/utilities/reference_tracked_object.h" #include #include namespace OCLRT { class AubCenter; class GmmHelper; class CommandStreamReceiver; class MemoryManager; class SourceLevelDebugger; class CompilerInterface; class BuiltIns; struct HardwareInfo; class OSInterface; using CsrContainer = std::vector>>; class ExecutionEnvironment : public ReferenceTrackedObject { private: std::mutex mtx; DeviceFactoryCleaner cleaner; protected: std::unique_ptr gmmHelper; public: ExecutionEnvironment(); ~ExecutionEnvironment() override; MOCKABLE_VIRTUAL void initAubCenter(const HardwareInfo *hwInfo, bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType); void initGmm(const HardwareInfo *hwInfo); bool initializeCommandStreamReceiver(const HardwareInfo *pHwInfo, uint32_t deviceIndex, uint32_t deviceCsrIndex); void initializeSpecialCommandStreamReceiver(const HardwareInfo &hwInfo); void initializeMemoryManager(bool enable64KBpages, bool enableLocalMemory, uint32_t deviceIndex, uint32_t deviceCsrIndex); void initSourceLevelDebugger(const HardwareInfo &hwInfo); GmmHelper *getGmmHelper() const; MOCKABLE_VIRTUAL CompilerInterface *getCompilerInterface(); BuiltIns *getBuiltIns(); 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 OCLRT