mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Add memory banks to Simulated CSR
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
2ce3a223f0
commit
c7a936d1f4
@@ -18,7 +18,7 @@ set(NEO_CORE_MEMORY_MANAGER
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_deletion.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/engine_limits.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions/engine_limits.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions/storage_info.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions/storage_info.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/eviction_status.h
|
||||
@@ -27,7 +27,6 @@ set(NEO_CORE_MEMORY_MANAGER
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gfx_partition.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/graphics_allocation.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/graphics_allocation.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/graphics_allocation_extra.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/host_ptr_defines.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/host_ptr_manager.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/host_ptr_manager.h
|
||||
@@ -53,7 +52,6 @@ set(NEO_CORE_MEMORY_MANAGER
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/surface.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/unified_memory_manager.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/unified_memory_manager.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${BRANCH_DIR_SUFFIX}/unified_memory_manager_extra.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/page_table.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/page_table.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/page_table.inl
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace NEO {
|
||||
namespace EngineLimits {
|
||||
|
||||
constexpr uint32_t maxHandleCount = 1u;
|
||||
constexpr uint32_t maxHandleCount = 4u;
|
||||
|
||||
}; // namespace EngineLimits
|
||||
} // namespace NEO
|
||||
|
||||
@@ -80,6 +80,24 @@ bool GraphicsAllocation::isAllocationLockable() const {
|
||||
return 0 == gmm->resourceParams.Flags.Info.NotLockable;
|
||||
}
|
||||
|
||||
void GraphicsAllocation::setAubWritable(bool writable, uint32_t banks) {
|
||||
UNRECOVERABLE_IF(banks == 0);
|
||||
aubInfo.aubWritable = static_cast<uint32_t>(setBits(aubInfo.aubWritable, writable, banks));
|
||||
}
|
||||
|
||||
bool GraphicsAllocation::isAubWritable(uint32_t banks) const {
|
||||
return isAnyBitSet(aubInfo.aubWritable, banks);
|
||||
}
|
||||
|
||||
void GraphicsAllocation::setTbxWritable(bool writable, uint32_t banks) {
|
||||
UNRECOVERABLE_IF(banks == 0);
|
||||
aubInfo.tbxWritable = static_cast<uint32_t>(setBits(aubInfo.tbxWritable, writable, banks));
|
||||
}
|
||||
|
||||
bool GraphicsAllocation::isTbxWritable(uint32_t banks) const {
|
||||
return isAnyBitSet(aubInfo.tbxWritable, banks);
|
||||
}
|
||||
|
||||
constexpr uint32_t GraphicsAllocation::objectNotUsed;
|
||||
constexpr uint32_t GraphicsAllocation::objectNotResident;
|
||||
constexpr uint32_t GraphicsAllocation::objectAlwaysResident;
|
||||
|
||||
@@ -10,14 +10,13 @@
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/source/memory_manager/definitions/engine_limits.h"
|
||||
#include "shared/source/memory_manager/definitions/storage_info.h"
|
||||
#include "shared/source/memory_manager/host_ptr_defines.h"
|
||||
#include "shared/source/memory_manager/memory_pool.h"
|
||||
#include "shared/source/utilities/idlist.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
#include "engine_limits.h"
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <cstddef>
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
void GraphicsAllocation::setAubWritable(bool writable, uint32_t banks) { aubInfo.aubWritable = writable; }
|
||||
bool GraphicsAllocation::isAubWritable(uint32_t banks) const { return (aubInfo.aubWritable != 0); }
|
||||
void GraphicsAllocation::setTbxWritable(bool writable, uint32_t banks) { aubInfo.tbxWritable = writable; }
|
||||
bool GraphicsAllocation::isTbxWritable(uint32_t banks) const { return (aubInfo.tbxWritable != 0); }
|
||||
|
||||
} // namespace NEO
|
||||
@@ -496,4 +496,20 @@ void SVMAllocsManager::removeSvmMapOperation(const void *regionSvmPtr) {
|
||||
svmMapOperations.remove(regionSvmPtr);
|
||||
}
|
||||
|
||||
GraphicsAllocation::AllocationType SVMAllocsManager::getGraphicsAllocationType(const UnifiedMemoryProperties &unifiedMemoryProperties) const {
|
||||
GraphicsAllocation::AllocationType allocationType = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY;
|
||||
if (unifiedMemoryProperties.memoryType == InternalMemoryType::DEVICE_UNIFIED_MEMORY) {
|
||||
if (unifiedMemoryProperties.allocationFlags.allocFlags.allocWriteCombined) {
|
||||
allocationType = GraphicsAllocation::AllocationType::WRITE_COMBINED;
|
||||
} else {
|
||||
if (DebugManager.flags.EnableStatelessCompression.get()) {
|
||||
allocationType = GraphicsAllocation::AllocationType::BUFFER_COMPRESSED;
|
||||
} else {
|
||||
allocationType = GraphicsAllocation::AllocationType::BUFFER;
|
||||
}
|
||||
}
|
||||
}
|
||||
return allocationType;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
GraphicsAllocation::AllocationType SVMAllocsManager::getGraphicsAllocationType(const UnifiedMemoryProperties &unifiedMemoryProperties) const {
|
||||
GraphicsAllocation::AllocationType allocationType = GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY;
|
||||
if (unifiedMemoryProperties.memoryType == InternalMemoryType::DEVICE_UNIFIED_MEMORY) {
|
||||
if (unifiedMemoryProperties.allocationFlags.allocFlags.allocWriteCombined) {
|
||||
allocationType = GraphicsAllocation::AllocationType::WRITE_COMBINED;
|
||||
} else {
|
||||
allocationType = GraphicsAllocation::AllocationType::BUFFER;
|
||||
}
|
||||
}
|
||||
return allocationType;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user