mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Move SystemInfoImpl logic to SystemInfo
Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fe0ab11fbb
commit
2319a56557
@@ -5,7 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/system_info_impl.h"
|
||||
#include "shared/source/os_interface/linux/system_info.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/libult/linux/drm_mock.h"
|
||||
@@ -29,7 +29,7 @@ TEST(DrmSystemInfoTest, whenQueryingSystemInfoThenSystemInfoIsNotCreatedAndIoctl
|
||||
}
|
||||
|
||||
TEST(DrmSystemInfoTest, givenSystemInfoCreatedWhenQueryingSpecificAtrributesThenReturnZero) {
|
||||
SystemInfoImpl systemInfo(nullptr, 0);
|
||||
SystemInfo systemInfo(nullptr, 0);
|
||||
|
||||
EXPECT_EQ(0u, systemInfo.getL3CacheSizeInKb());
|
||||
EXPECT_EQ(0u, systemInfo.getL3BankCount());
|
||||
@@ -105,7 +105,7 @@ TEST(DrmSystemInfoTest, whenQueryingSystemInfoThenSystemInfoIsCreatedAndReturnsN
|
||||
}
|
||||
|
||||
TEST(DrmSystemInfoTest, givenSystemInfoCreatedFromDeviceBlobWhenQueryingSpecificAtrributesThenReturnCorrectValues) {
|
||||
SystemInfoImpl systemInfo(dummyDeviceBlobData, sizeof(dummyDeviceBlobData));
|
||||
SystemInfo systemInfo(dummyDeviceBlobData, sizeof(dummyDeviceBlobData));
|
||||
|
||||
EXPECT_EQ(0x0Au, systemInfo.getMaxMemoryChannels());
|
||||
EXPECT_EQ(0x0Bu, systemInfo.getMemoryType());
|
||||
|
||||
@@ -80,9 +80,8 @@ set(NEO_CORE_OS_INTERFACE_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/settings_reader_create.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sys_calls.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/system_info.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/system_info_impl.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/system_info_impl.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/system_info_impl_extended.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/system_info.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/system_info_extended.cpp
|
||||
)
|
||||
if(SUPPORT_XEHP_AND_LATER)
|
||||
list(APPEND NEO_CORE_OS_INTERFACE_LINUX
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "shared/source/os_interface/linux/local_memory_helper.h"
|
||||
#include "shared/source/os_interface/linux/memory_info_impl.h"
|
||||
#include "shared/source/os_interface/linux/sys_calls.h"
|
||||
#include "shared/source/os_interface/linux/system_info_impl.h"
|
||||
#include "shared/source/os_interface/linux/system_info.h"
|
||||
|
||||
#include "drm_neo.h"
|
||||
#include "drm_query_flags.h"
|
||||
@@ -111,7 +111,7 @@ bool Drm::querySystemInfo() {
|
||||
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stdout, "%s", "INFO: System Info query failed!\n");
|
||||
return false;
|
||||
}
|
||||
this->systemInfo.reset(new SystemInfoImpl(deviceBlob, length));
|
||||
this->systemInfo.reset(new SystemInfo(deviceBlob, length));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/system_info_impl.h"
|
||||
#include "shared/source/os_interface/linux/system_info.h"
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
@@ -15,11 +15,11 @@
|
||||
|
||||
namespace NEO {
|
||||
|
||||
SystemInfoImpl::SystemInfoImpl(const uint32_t *blobData, int32_t blobSize) {
|
||||
SystemInfo::SystemInfo(const uint32_t *blobData, int32_t blobSize) {
|
||||
this->parseDeviceBlob(blobData, blobSize);
|
||||
}
|
||||
|
||||
void SystemInfoImpl::parseDeviceBlob(const uint32_t *data, int32_t size) {
|
||||
void SystemInfo::parseDeviceBlob(const uint32_t *data, int32_t size) {
|
||||
|
||||
uint32_t i = 0;
|
||||
while (i < (size / sizeof(uint32_t))) {
|
||||
@@ -10,29 +10,52 @@
|
||||
|
||||
namespace NEO {
|
||||
struct HardwareInfo;
|
||||
struct SystemInfo {
|
||||
SystemInfo() = default;
|
||||
virtual ~SystemInfo() = 0;
|
||||
|
||||
virtual uint32_t getMaxSlicesSupported() const = 0;
|
||||
virtual uint32_t getMaxDualSubSlicesSupported() const = 0;
|
||||
virtual uint32_t getMaxEuPerDualSubSlice() const = 0;
|
||||
virtual uint64_t getL3CacheSizeInKb() const = 0;
|
||||
virtual uint32_t getL3BankCount() const = 0;
|
||||
virtual uint32_t getMemoryType() const = 0;
|
||||
virtual uint32_t getMaxMemoryChannels() const = 0;
|
||||
virtual uint32_t getNumThreadsPerEu() const = 0;
|
||||
virtual uint32_t getTotalVsThreads() const = 0;
|
||||
virtual uint32_t getTotalHsThreads() const = 0;
|
||||
virtual uint32_t getTotalDsThreads() const = 0;
|
||||
virtual uint32_t getTotalGsThreads() const = 0;
|
||||
virtual uint32_t getTotalPsThreads() const = 0;
|
||||
virtual uint32_t getMaxFillRate() const = 0;
|
||||
virtual uint32_t getMaxRCS() const = 0;
|
||||
virtual uint32_t getMaxCCS() const = 0;
|
||||
virtual void checkSysInfoMismatch(HardwareInfo *hwInfo) = 0;
|
||||
struct SystemInfo {
|
||||
|
||||
SystemInfo(const uint32_t *blobData, int32_t blobSize);
|
||||
|
||||
~SystemInfo() = default;
|
||||
|
||||
uint32_t getMaxSlicesSupported() const { return maxSlicesSupported; }
|
||||
uint32_t getMaxDualSubSlicesSupported() const { return maxDualSubSlicesSupported; }
|
||||
uint32_t getMaxEuPerDualSubSlice() const { return maxEuPerDualSubSlice; }
|
||||
uint64_t getL3CacheSizeInKb() const { return L3CacheSizeInKb; }
|
||||
uint32_t getL3BankCount() const { return L3BankCount; }
|
||||
uint32_t getMemoryType() const { return memoryType; }
|
||||
uint32_t getMaxMemoryChannels() const { return maxMemoryChannels; }
|
||||
uint32_t getNumThreadsPerEu() const { return numThreadsPerEu; }
|
||||
uint32_t getTotalVsThreads() const { return totalVsThreads; }
|
||||
uint32_t getTotalHsThreads() const { return totalHsThreads; }
|
||||
uint32_t getTotalDsThreads() const { return totalDsThreads; }
|
||||
uint32_t getTotalGsThreads() const { return totalGsThreads; }
|
||||
uint32_t getTotalPsThreads() const { return totalPsThreads; }
|
||||
uint32_t getMaxFillRate() const { return maxFillRate; }
|
||||
uint32_t getMaxRCS() const { return maxRCS; }
|
||||
uint32_t getMaxCCS() const { return maxCCS; }
|
||||
|
||||
void checkSysInfoMismatch(HardwareInfo *hwInfo);
|
||||
|
||||
protected:
|
||||
void parseDeviceBlob(const uint32_t *data, int32_t size);
|
||||
void extendParseDeviceBlob(const uint32_t *data, uint32_t element);
|
||||
|
||||
uint32_t maxSlicesSupported = 0;
|
||||
uint32_t maxDualSubSlicesSupported = 0;
|
||||
uint32_t maxEuPerDualSubSlice = 0;
|
||||
uint64_t L3CacheSizeInKb = 0;
|
||||
uint32_t L3BankCount = 0;
|
||||
uint32_t memoryType = 0;
|
||||
uint32_t maxMemoryChannels = 0;
|
||||
uint32_t numThreadsPerEu = 0;
|
||||
uint32_t totalVsThreads = 0;
|
||||
uint32_t totalHsThreads = 0;
|
||||
uint32_t totalDsThreads = 0;
|
||||
uint32_t totalGsThreads = 0;
|
||||
uint32_t totalPsThreads = 0;
|
||||
uint32_t maxFillRate = 0;
|
||||
uint32_t maxRCS = 0;
|
||||
uint32_t maxCCS = 0;
|
||||
};
|
||||
|
||||
inline SystemInfo::~SystemInfo() {}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
15
shared/source/os_interface/linux/system_info_extended.cpp
Normal file
15
shared/source/os_interface/linux/system_info_extended.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/system_info.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
void SystemInfo::checkSysInfoMismatch(HardwareInfo *hwInfo) {}
|
||||
void SystemInfo::extendParseDeviceBlob(const uint32_t *data, uint32_t element) {}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/os_interface/linux/system_info.h"
|
||||
|
||||
namespace NEO {
|
||||
struct HardwareInfo;
|
||||
|
||||
class SystemInfoImpl : public SystemInfo {
|
||||
public:
|
||||
SystemInfoImpl(const uint32_t *blobData, int32_t blobSize);
|
||||
|
||||
~SystemInfoImpl() override = default;
|
||||
|
||||
uint32_t getMaxSlicesSupported() const override { return maxSlicesSupported; }
|
||||
uint32_t getMaxDualSubSlicesSupported() const override { return maxDualSubSlicesSupported; }
|
||||
uint32_t getMaxEuPerDualSubSlice() const override { return maxEuPerDualSubSlice; }
|
||||
uint64_t getL3CacheSizeInKb() const override { return L3CacheSizeInKb; }
|
||||
uint32_t getL3BankCount() const override { return L3BankCount; }
|
||||
uint32_t getMemoryType() const override { return memoryType; }
|
||||
uint32_t getMaxMemoryChannels() const override { return maxMemoryChannels; }
|
||||
uint32_t getNumThreadsPerEu() const override { return numThreadsPerEu; }
|
||||
uint32_t getTotalVsThreads() const override { return totalVsThreads; }
|
||||
uint32_t getTotalHsThreads() const override { return totalHsThreads; }
|
||||
uint32_t getTotalDsThreads() const override { return totalDsThreads; }
|
||||
uint32_t getTotalGsThreads() const override { return totalGsThreads; }
|
||||
uint32_t getTotalPsThreads() const override { return totalPsThreads; }
|
||||
uint32_t getMaxFillRate() const override { return maxFillRate; }
|
||||
uint32_t getMaxRCS() const override { return maxRCS; }
|
||||
uint32_t getMaxCCS() const override { return maxCCS; }
|
||||
|
||||
void checkSysInfoMismatch(HardwareInfo *hwInfo) override;
|
||||
|
||||
protected:
|
||||
void parseDeviceBlob(const uint32_t *data, int32_t size);
|
||||
void extendParseDeviceBlob(const uint32_t *data, uint32_t element);
|
||||
|
||||
uint32_t maxSlicesSupported = 0;
|
||||
uint32_t maxDualSubSlicesSupported = 0;
|
||||
uint32_t maxEuPerDualSubSlice = 0;
|
||||
uint64_t L3CacheSizeInKb = 0;
|
||||
uint32_t L3BankCount = 0;
|
||||
uint32_t memoryType = 0;
|
||||
uint32_t maxMemoryChannels = 0;
|
||||
uint32_t numThreadsPerEu = 0;
|
||||
uint32_t totalVsThreads = 0;
|
||||
uint32_t totalHsThreads = 0;
|
||||
uint32_t totalDsThreads = 0;
|
||||
uint32_t totalGsThreads = 0;
|
||||
uint32_t totalPsThreads = 0;
|
||||
uint32_t maxFillRate = 0;
|
||||
uint32_t maxRCS = 0;
|
||||
uint32_t maxCCS = 0;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/system_info_impl.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
void SystemInfoImpl::checkSysInfoMismatch(HardwareInfo *hwInfo) {}
|
||||
void SystemInfoImpl::extendParseDeviceBlob(const uint32_t *data, uint32_t element) {}
|
||||
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user