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