mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
[1/n] Log allocation placement.
Change-Id: I9ab61e10dcb0fcbbaf859c077a64ce7a4f2c213c
This commit is contained in:
committed by
sys_ocldev
parent
e987d41dd6
commit
75a635fdc5
@@ -7,8 +7,15 @@
|
||||
|
||||
#include "runtime/helpers/aligned_memory.h"
|
||||
#include "runtime/memory_manager/graphics_allocation.h"
|
||||
#include "runtime/os_interface/debug_settings_manager.h"
|
||||
|
||||
namespace OCLRT {
|
||||
|
||||
void GraphicsAllocation::setAllocationType(AllocationType allocationType) {
|
||||
DebugManager.logAllocation(this);
|
||||
this->allocationType = allocationType;
|
||||
}
|
||||
|
||||
bool GraphicsAllocation::isL3Capable() {
|
||||
auto ptr = ptrOffset(cpuPtr, static_cast<size_t>(this->allocationOffset));
|
||||
if (alignUp(ptr, MemoryConstants::cacheLineSize) == ptr && alignUp(this->size, MemoryConstants::cacheLineSize) == this->size) {
|
||||
@@ -42,6 +49,11 @@ void GraphicsAllocation::updateTaskCount(uint32_t newTaskCount, uint32_t context
|
||||
}
|
||||
usageInfos[contextId].taskCount = newTaskCount;
|
||||
}
|
||||
|
||||
std::string GraphicsAllocation::getAllocationInfoString() const {
|
||||
return "";
|
||||
}
|
||||
|
||||
constexpr uint32_t GraphicsAllocation::objectNotUsed;
|
||||
constexpr uint32_t GraphicsAllocation::objectNotResident;
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -96,7 +96,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
|
||||
void setSize(size_t size) { this->size = size; }
|
||||
osHandle peekSharedHandle() { return sharedHandle; }
|
||||
|
||||
void setAllocationType(AllocationType allocationType) { this->allocationType = allocationType; }
|
||||
void setAllocationType(AllocationType allocationType);
|
||||
AllocationType getAllocationType() const { return allocationType; }
|
||||
|
||||
void setAubWritable(bool writable) { aubWritable = writable; }
|
||||
@@ -117,7 +117,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
|
||||
void incReuseCount() { reuseCount++; }
|
||||
void decReuseCount() { reuseCount--; }
|
||||
uint32_t peekReuseCount() const { return reuseCount; }
|
||||
MemoryPool::Type getMemoryPool() {
|
||||
MemoryPool::Type getMemoryPool() const {
|
||||
return memoryPool;
|
||||
}
|
||||
bool isUsed() const { return registeredContextsNum > 0; }
|
||||
@@ -136,6 +136,8 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
|
||||
bool isMultiOsContextCapable() const { return multiOsContextCapable; }
|
||||
bool isUsedByManyOsContexts() const { return registeredContextsNum > 1u; }
|
||||
|
||||
virtual std::string getAllocationInfoString() const;
|
||||
|
||||
protected:
|
||||
constexpr static uint32_t objectNotResident = (uint32_t)-1;
|
||||
constexpr static uint32_t objectNotUsed = (uint32_t)-1;
|
||||
|
||||
Reference in New Issue
Block a user