Revert "feature: add host function allocation"

This reverts commit 75b4de70cd.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2025-09-23 01:41:13 +02:00
committed by Compute-Runtime-Automation
parent 39a3ea0e0e
commit 16a6c3ca8a
20 changed files with 15 additions and 175 deletions

View File

@@ -40,7 +40,6 @@ bool AubHelper::isOneTimeAubWritableAllocationType(const AllocationType &type) {
case AllocationType::assertBuffer:
case AllocationType::tagBuffer:
case AllocationType::syncDispatchToken:
case AllocationType::hostFunction:
return true;
case AllocationType::bufferHostMemory:
return NEO::debugManager.isTbxPageFaultManagerEnabled() ||

View File

@@ -418,16 +418,6 @@ void CommandStreamReceiver::cleanupResources() {
tagsMultiAllocation = nullptr;
}
if (hostFunctionDataMultiAllocation) {
hostFunctionDataAllocation = nullptr;
for (auto graphicsAllocation : hostFunctionDataMultiAllocation->getGraphicsAllocations()) {
getMemoryManager()->freeGraphicsMemory(graphicsAllocation);
}
delete hostFunctionDataMultiAllocation;
hostFunctionDataMultiAllocation = nullptr;
}
if (globalFenceAllocation) {
getMemoryManager()->freeGraphicsMemory(globalFenceAllocation);
globalFenceAllocation = nullptr;
@@ -548,7 +538,7 @@ void CommandStreamReceiver::setTagAllocation(GraphicsAllocation *allocation) {
reinterpret_cast<uint8_t *>(allocation->getUnderlyingBuffer()) + TagAllocationLayout::debugPauseStateAddressOffset);
}
MultiGraphicsAllocation &CommandStreamReceiver::createMultiAllocationInSystemMemoryPool(AllocationType allocationType) {
MultiGraphicsAllocation &CommandStreamReceiver::createTagsMultiAllocation() {
RootDeviceIndicesContainer rootDeviceIndices;
rootDeviceIndices.pushUnique(rootDeviceIndex);
@@ -556,7 +546,7 @@ MultiGraphicsAllocation &CommandStreamReceiver::createMultiAllocationInSystemMem
auto maxRootDeviceIndex = static_cast<uint32_t>(this->executionEnvironment.rootDeviceEnvironments.size() - 1);
auto allocations = new MultiGraphicsAllocation(maxRootDeviceIndex);
AllocationProperties unifiedMemoryProperties{rootDeviceIndex, MemoryConstants::pageSize, allocationType, systemMemoryBitfield};
AllocationProperties unifiedMemoryProperties{rootDeviceIndex, MemoryConstants::pageSize, AllocationType::tagBuffer, systemMemoryBitfield};
this->getMemoryManager()->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices, unifiedMemoryProperties, *allocations);
return *allocations;
@@ -705,37 +695,6 @@ void *CommandStreamReceiver::getIndirectHeapCurrentPtr(IndirectHeapType heapType
return nullptr;
}
void CommandStreamReceiver::ensureHostFunctionDataInitialization() {
if (hostFunctionInitialized == false) {
initializeHostFunctionData();
}
}
void CommandStreamReceiver::initializeHostFunctionData() {
auto lock = obtainUniqueOwnership();
if (hostFunctionInitialized) {
return;
}
this->hostFunctionDataMultiAllocation = &this->createMultiAllocationInSystemMemoryPool(AllocationType::hostFunction);
this->hostFunctionDataAllocation = hostFunctionDataMultiAllocation->getGraphicsAllocation(rootDeviceIndex);
void *hostFunctionBuffer = hostFunctionDataAllocation->getUnderlyingBuffer();
this->hostFunctionData.entry = reinterpret_cast<decltype(HostFunctionData::entry)>(ptrOffset(hostFunctionBuffer, HostFunctionHelper::entryOffset));
this->hostFunctionData.userData = reinterpret_cast<decltype(HostFunctionData::userData)>(ptrOffset(hostFunctionBuffer, HostFunctionHelper::userDataOffset));
this->hostFunctionData.internalTag = reinterpret_cast<decltype(HostFunctionData::internalTag)>(ptrOffset(hostFunctionBuffer, HostFunctionHelper::internalTagOffset));
this->hostFunctionInitialized = true;
}
HostFunctionData &CommandStreamReceiver::getHostFunctionData() {
return hostFunctionData;
}
GraphicsAllocation *CommandStreamReceiver::getHostFunctionDataAllocation() {
return hostFunctionDataAllocation;
}
IndirectHeap &CommandStreamReceiver::getIndirectHeap(IndirectHeap::Type heapType,
size_t minRequiredSize) {
DEBUG_BREAK_IF(static_cast<uint32_t>(heapType) >= arrayCount(indirectHeap));
@@ -865,12 +824,8 @@ void *CommandStreamReceiver::asyncDebugBreakConfirmation(void *arg) {
return nullptr;
}
void CommandStreamReceiver::makeResidentHostFunctionAllocation() {
makeResident(*hostFunctionDataAllocation);
}
bool CommandStreamReceiver::initializeTagAllocation() {
this->tagsMultiAllocation = &this->createMultiAllocationInSystemMemoryPool(AllocationType::tagBuffer);
this->tagsMultiAllocation = &this->createTagsMultiAllocation();
auto tagAllocation = tagsMultiAllocation->getGraphicsAllocation(rootDeviceIndex);
if (!tagAllocation) {

View File

@@ -6,7 +6,6 @@
*/
#pragma once
#include "shared/source/command_stream/host_function.h"
#include "shared/source/command_stream/linear_stream.h"
#include "shared/source/command_stream/memory_compression_state.h"
#include "shared/source/command_stream/preemption_mode.h"
@@ -161,8 +160,8 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass {
MultiGraphicsAllocation *getTagsMultiAllocation() const {
return tagsMultiAllocation;
}
MultiGraphicsAllocation &createMultiAllocationInSystemMemoryPool(AllocationType allocationType);
void makeResidentHostFunctionAllocation();
MultiGraphicsAllocation &createTagsMultiAllocation();
TaskCountType getNextBarrierCount() { return this->barrierCount.fetch_add(1u); }
TaskCountType peekBarrierCount() const { return this->barrierCount.load(); }
volatile TagAddressType *getTagAddress() const { return tagAddress; }
@@ -565,13 +564,7 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass {
MOCKABLE_VIRTUAL uint32_t getContextGroupId() const;
void ensureHostFunctionDataInitialization();
HostFunctionData &getHostFunctionData();
GraphicsAllocation *getHostFunctionDataAllocation();
protected:
MOCKABLE_VIRTUAL void initializeHostFunctionData();
virtual CompletionStamp flushTaskHeapless(LinearStream &commandStreamTask, size_t commandStreamTaskStart,
const IndirectHeap *dsh, const IndirectHeap *ioh, const IndirectHeap *ssh,
TaskCountType taskLevel, DispatchFlags &dispatchFlags, Device &device) = 0;
@@ -644,13 +637,11 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass {
GraphicsAllocation *globalStatelessHeapAllocation = nullptr;
MultiGraphicsAllocation *tagsMultiAllocation = nullptr;
MultiGraphicsAllocation *hostFunctionDataMultiAllocation = nullptr;
GraphicsAllocation *hostFunctionDataAllocation = nullptr;
IndirectHeap *indirectHeap[IndirectHeapType::numTypes];
OsContext *osContext = nullptr;
CommandStreamReceiver *primaryCsr = nullptr;
TaskCountType *completionFenceValuePointer = nullptr;
HostFunctionData hostFunctionData;
std::atomic<TaskCountType> barrierCount{0};
// current taskLevel. Used for determining if a PIPE_CONTROL is needed.
@@ -681,6 +672,7 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass {
uint32_t immWritePostSyncWriteOffset = 0;
uint32_t timeStampPostSyncWriteOffset = 0;
TaskCountType completionFenceValue = 0;
const uint32_t rootDeviceIndex;
const DeviceBitfield deviceBitfield;
@@ -705,7 +697,7 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass {
bool requiresInstructionCacheFlush = false;
bool requiresDcFlush = false;
bool pushAllocationsForMakeResident = true;
bool hostFunctionInitialized = false;
bool localMemoryEnabled = false;
bool pageTableManagerInitialized = false;

View File

@@ -60,8 +60,7 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching
return GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC;
} else if (AllocationType::semaphoreBuffer == allocationType) {
return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
} else if (AllocationType::tagBuffer == allocationType ||
AllocationType::hostFunction == allocationType) {
} else if (AllocationType::tagBuffer == allocationType) {
return GMM_RESOURCE_USAGE_OCL_BUFFER;
}
}
@@ -97,7 +96,6 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching
case AllocationType::svmZeroCopy:
case AllocationType::tagBuffer:
case AllocationType::printfSurface:
case AllocationType::hostFunction:
if (debugManager.flags.DisableCachingForStatefulBufferAccess.get()) {
return getDefaultUsageTypeWithCachingDisabled(allocationType, productHelper);
}

View File

@@ -118,8 +118,6 @@ const char *AppResourceHelper::getResourceTagStr(AllocationType type) {
return "ASSRTBUF";
case AllocationType::syncDispatchToken:
return "SYNCTOK";
case AllocationType::hostFunction:
return "HOSTFUNC";
default:
return "NOTFOUND";
}

View File

@@ -59,7 +59,6 @@ enum class AllocationType {
deferredTasksList,
assertBuffer,
syncDispatchToken,
hostFunction,
count
};

View File

@@ -600,7 +600,6 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
case AllocationType::debugContextSaveArea:
case AllocationType::debugSbaTrackingBuffer:
case AllocationType::swTagBuffer:
case AllocationType::hostFunction:
allocationData.flags.useSystemMemory = true;
default:
break;

View File

@@ -221,8 +221,6 @@ const char *getAllocationTypeString(GraphicsAllocation const *graphicsAllocation
return "ASSERT_BUFFER";
case AllocationType::syncDispatchToken:
return "SYNC_DISPATCH_TOKEN";
case AllocationType::hostFunction:
return "HOST_FUNCTION";
default:
return "ILLEGAL_VALUE";
}

View File

@@ -56,7 +56,6 @@ std::optional<GfxMemoryAllocationMethod> ProductHelperHw<gfxProduct>::getPreferr
switch (allocationType) {
case AllocationType::tagBuffer:
case AllocationType::timestampPacketTagBuffer:
case AllocationType::hostFunction:
return {};
default:
return GfxMemoryAllocationMethod::allocateByKmd;