mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
Related-To: LOCI-4118 Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
59 lines
1.9 KiB
C++
59 lines
1.9 KiB
C++
/*
|
|
* Copyright (C) 2023 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "shared/source/execution_environment/execution_environment.h"
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
|
#include "shared/source/helpers/hw_info.h"
|
|
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
|
|
|
#include "level_zero/sysman/source/sysman_device.h"
|
|
|
|
#include <unordered_map>
|
|
|
|
namespace L0 {
|
|
namespace Sysman {
|
|
struct OsSysman;
|
|
|
|
struct SysmanDeviceImp : SysmanDevice, NEO::NonCopyableOrMovableClass {
|
|
|
|
SysmanDeviceImp(NEO::ExecutionEnvironment *executionEnvironment, const uint32_t rootDeviceIndex);
|
|
~SysmanDeviceImp() override;
|
|
|
|
SysmanDeviceImp() = delete;
|
|
ze_result_t init();
|
|
|
|
OsSysman *pOsSysman = nullptr;
|
|
const NEO::RootDeviceEnvironment &getRootDeviceEnvironment() const {
|
|
return *executionEnvironment->rootDeviceEnvironments[rootDeviceIndex];
|
|
}
|
|
const NEO::HardwareInfo &getHardwareInfo() const override { return *getRootDeviceEnvironment().getHardwareInfo(); }
|
|
PRODUCT_FAMILY getProductFamily() const { return getHardwareInfo().platform.eProductFamily; }
|
|
NEO::ExecutionEnvironment *getExecutionEnvironment() const { return executionEnvironment; }
|
|
uint32_t getRootDeviceIndex() const { return rootDeviceIndex; }
|
|
|
|
FabricPortHandleContext *pFabricPortHandleContext = nullptr;
|
|
MemoryHandleContext *pMemoryHandleContext = nullptr;
|
|
|
|
ze_result_t fabricPortGet(uint32_t *pCount, zes_fabric_port_handle_t *phPort) override;
|
|
ze_result_t memoryGet(uint32_t *pCount, zes_mem_handle_t *phMemory) override;
|
|
|
|
private:
|
|
NEO::ExecutionEnvironment *executionEnvironment = nullptr;
|
|
const uint32_t rootDeviceIndex;
|
|
template <typename T>
|
|
void inline freeResource(T *&resource) {
|
|
if (resource) {
|
|
delete resource;
|
|
resource = nullptr;
|
|
}
|
|
}
|
|
};
|
|
|
|
} // namespace Sysman
|
|
} // namespace L0
|