fix: add missing writeMemory for pooled global surface

Related-To: HSD-18043489182, HSD-18043476772
Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
Fabian Zwoliński
2025-10-16 16:23:08 +00:00
committed by Compute-Runtime-Automation
parent 64b79723cc
commit 6102280f71
18 changed files with 415 additions and 23 deletions

View File

@@ -16,10 +16,13 @@ namespace NEO {
class SharedPoolAllocation {
public:
SharedPoolAllocation(GraphicsAllocation *graphicsAllocation, size_t offset, size_t size, std::mutex *mtx)
: graphicsAllocation(graphicsAllocation), offset(offset), size(size), mtx(mtx){};
: SharedPoolAllocation(graphicsAllocation, offset, size, mtx, true){};
SharedPoolAllocation(GraphicsAllocation *graphicsAllocation, size_t offset, size_t size, std::mutex *mtx, bool isFromPool)
: graphicsAllocation(graphicsAllocation), offset(offset), size(size), mtx(mtx), fromPool(isFromPool){};
explicit SharedPoolAllocation(GraphicsAllocation *graphicsAllocation)
: graphicsAllocation(graphicsAllocation), offset(0u), size(graphicsAllocation ? graphicsAllocation->getUnderlyingBufferSize() : 0u), mtx(nullptr){};
: graphicsAllocation(graphicsAllocation), offset(0u), size(graphicsAllocation ? graphicsAllocation->getUnderlyingBufferSize() : 0u), mtx(nullptr), fromPool(false){};
GraphicsAllocation *getGraphicsAllocation() const {
return graphicsAllocation;
@@ -57,11 +60,20 @@ class SharedPoolAllocation {
}
}
std::mutex *getMutex() const {
return mtx;
}
bool isFromPool() const {
return fromPool;
}
private:
GraphicsAllocation *graphicsAllocation;
const size_t offset;
const size_t size;
std::mutex *mtx; // This mutex is shared across all users of this GA
const bool fromPool = true;
};
} // namespace NEO