Redesign ULT by mocking sysfs and implementing for memory

Change-Id: I24206628212284f180fe4e5a239ab2ed58ffa8ea
This commit is contained in:
Mraghuwa
2020-05-23 18:48:56 +05:30
committed by sys_ocldev
parent 01174f5166
commit 46b069b9d0
7 changed files with 132 additions and 8 deletions

View File

@@ -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)

View File

@@ -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;
}

View 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