mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 15:03:02 +08:00
AubHelper: Local memory support
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5e408e5e6e
commit
83db85cf86
@@ -8,11 +8,12 @@ set(NEO_CORE_AUB
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_center.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_center.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/aub_helper.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper_add_mmio.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper_base.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper_bdw_plus.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/aub_helper_extra.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_mapper_base.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_stream_provider.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_subcapture.cpp
|
||||
|
||||
@@ -7,8 +7,12 @@
|
||||
|
||||
#include "shared/source/aub/aub_helper.h"
|
||||
|
||||
#include "shared/source/aub_mem_dump/page_table_entry_bits.h"
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/basic_math.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/tbx/tbx_proto.h"
|
||||
|
||||
#include "aub_mem_dump.h"
|
||||
#include "third_party/aub_stream/headers/aubstream.h"
|
||||
@@ -16,28 +20,32 @@
|
||||
namespace NEO {
|
||||
|
||||
uint64_t AubHelper::getTotalMemBankSize() {
|
||||
return 2 * GB;
|
||||
return 32ull * MemoryConstants::gigaByte;
|
||||
}
|
||||
|
||||
int AubHelper::getMemTrace(uint64_t pdEntryBits) {
|
||||
if (pdEntryBits & BIT(PageTableEntry::localMemoryBit)) {
|
||||
return AubMemDump::AddressSpaceValues::TraceLocal;
|
||||
}
|
||||
return AubMemDump::AddressSpaceValues::TraceNonlocal;
|
||||
}
|
||||
|
||||
uint64_t AubHelper::getPTEntryBits(uint64_t pdEntryBits) {
|
||||
pdEntryBits &= ~BIT(PageTableEntry::localMemoryBit);
|
||||
return pdEntryBits;
|
||||
}
|
||||
|
||||
uint32_t AubHelper::getMemType(uint32_t addressSpace) {
|
||||
return 0;
|
||||
if (addressSpace == AubMemDump::AddressSpaceValues::TraceLocal) {
|
||||
return mem_types::MEM_TYPE_LOCALMEM;
|
||||
}
|
||||
return mem_types::MEM_TYPE_SYSTEM;
|
||||
}
|
||||
|
||||
uint64_t AubHelper::getMemBankSize(const HardwareInfo *pHwInfo) {
|
||||
return getTotalMemBankSize();
|
||||
}
|
||||
|
||||
void AubHelper::setTbxConfiguration() {
|
||||
aub_stream::setTbxServerIp(DebugManager.flags.TbxServer.get());
|
||||
aub_stream::setTbxServerPort(DebugManager.flags.TbxPort.get());
|
||||
aub_stream::setTbxFrontdoorMode(DebugManager.flags.TbxFrontdoorMode.get());
|
||||
if (DebugManager.flags.HBMSizePerTileInGigabytes.get() > 0) {
|
||||
return DebugManager.flags.HBMSizePerTileInGigabytes.get() * MemoryConstants::gigaByte;
|
||||
}
|
||||
return getTotalMemBankSize() / HwHelper::getSubDevicesCount(pHwInfo);
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
21
shared/source/aub/aub_helper_extra.cpp
Normal file
21
shared/source/aub/aub_helper_extra.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/aub/aub_helper.h"
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
|
||||
#include "aub_mem_dump.h"
|
||||
#include "third_party/aub_stream/headers/aubstream.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
void AubHelper::setTbxConfiguration() {
|
||||
aub_stream::setTbxServerIp(DebugManager.flags.TbxServer.get());
|
||||
aub_stream::setTbxServerPort(DebugManager.flags.TbxPort.get());
|
||||
aub_stream::setTbxFrontdoorMode(DebugManager.flags.TbxFrontdoorMode.get());
|
||||
}
|
||||
} // namespace NEO
|
||||
@@ -28,6 +28,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, AubDumpOverrideMmioRegisterValue, 0, "Value to o
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, ClDeviceGlobalMemSizeAvailablePercent, -1, "Percent of total GPU memory available; CL_DEVICE_GLOBAL_MEM_SIZE")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, SetCommandStreamReceiver, -1, "Set command stream receiver to: 0 - HW, 1 - AUB, 2 - TBX, 3 - HW & AUB, 4 - TBX & AUB")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, TbxPort, 4321, "TCP-IP port of TBX server")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, HBMSizePerTileInGigabytes, 0, "Size of HBM memory in GigaBytes per tile.")
|
||||
DECLARE_DEBUG_VARIABLE(bool, TbxFrontdoorMode, false, "Set TBX frontdoor mode for read and write memory accesses (the default mode is via backdoor)")
|
||||
DECLARE_DEBUG_VARIABLE(bool, FlattenBatchBufferForAUBDump, false, "Dump multi-level batch buffers to AUB as single, flat batch buffer")
|
||||
DECLARE_DEBUG_VARIABLE(bool, AddPatchInfoCommentsForAUBDump, false, "Dump comments containing allocations and patching information")
|
||||
|
||||
@@ -456,3 +456,9 @@ struct HAS_MSG {
|
||||
struct HAS_HDR hdr;
|
||||
union HAS_MSG_BODY u;
|
||||
};
|
||||
|
||||
enum mem_types : uint32_t {
|
||||
MEM_TYPE_SYSTEM = 0,
|
||||
MEM_TYPE_LOCALMEM = 1,
|
||||
MEM_TYPE_MAX = 4
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user