mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Redesign ULT by mocking sysfs and implementing for memory
Change-Id: I24206628212284f180fe4e5a239ab2ed58ffa8ea
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
#
|
||||
|
||||
set(L0_SRCS_TOOLS_SYSMAN_MEMORY_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/os_memory_imp.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/os_memory_imp.h
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
|
||||
@@ -5,17 +5,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sysman/memory/os_memory.h"
|
||||
#include "level_zero/tools/source/sysman/memory/linux/os_memory_imp.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
class LinuxMemoryImp : public OsMemory {
|
||||
public:
|
||||
ze_result_t getAllocSize(uint64_t &allocSize) override;
|
||||
ze_result_t getMaxSize(uint64_t &maxSize) override;
|
||||
ze_result_t getMemHealth(zet_mem_health_t &memHealth) override;
|
||||
};
|
||||
|
||||
ze_result_t LinuxMemoryImp::getAllocSize(uint64_t &allocSize) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
29
level_zero/tools/source/sysman/memory/linux/os_memory_imp.h
Normal file
29
level_zero/tools/source/sysman/memory/linux/os_memory_imp.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
|
||||
#include "sysman/memory/os_memory.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
class SysfsAccess;
|
||||
|
||||
class LinuxMemoryImp : public OsMemory, public NEO::NonCopyableClass {
|
||||
public:
|
||||
ze_result_t getAllocSize(uint64_t &allocSize) override;
|
||||
ze_result_t getMaxSize(uint64_t &maxSize) override;
|
||||
ze_result_t getMemHealth(zet_mem_health_t &memHealth) override;
|
||||
LinuxMemoryImp(OsSysman *pOsSysman);
|
||||
LinuxMemoryImp() = default;
|
||||
~LinuxMemoryImp() override = default;
|
||||
|
||||
protected:
|
||||
SysfsAccess *pSysfsAccess = nullptr;
|
||||
};
|
||||
} // namespace L0
|
||||
Reference in New Issue
Block a user