fix: capability to write memory chunk in aub/tbx mode

Related-To: GSD-6604

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-10-18 13:54:46 +00:00
committed by Compute-Runtime-Automation
parent faaceaaff8
commit 25195ebc96
22 changed files with 223 additions and 85 deletions

View File

@@ -33,6 +33,14 @@ struct WaitUserFenceParams {
bool forceRetStatusValue = true;
};
struct WriteMemoryParams {
GraphicsAllocation *latestGfxAllocation = nullptr;
uint64_t latestGpuVaChunkOffset = 0;
size_t latestChunkSize = 0;
uint32_t callCount = 0;
bool latestChunkedMode = false;
};
template <typename GfxFamily>
class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, public NonCopyableOrMovableClass {
using BaseClass = CommandStreamReceiverHw<GfxFamily>;
@@ -207,6 +215,17 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
return BaseClass::flushImmediateTask(immediateCommandStream, immediateCommandStreamStart, dispatchFlags, device);
}
bool writeMemory(GraphicsAllocation &gfxAllocation, bool isChunkCopy, uint64_t gpuVaChunkOffset, size_t chunkSize) override {
writeMemoryParams.callCount++;
writeMemoryParams.latestGfxAllocation = &gfxAllocation;
writeMemoryParams.latestChunkedMode = isChunkCopy;
writeMemoryParams.latestGpuVaChunkOffset = gpuVaChunkOffset;
writeMemoryParams.latestChunkSize = chunkSize;
return BaseClass::writeMemory(gfxAllocation, isChunkCopy, gpuVaChunkOffset, chunkSize);
}
size_t getPreferredTagPoolSize() const override {
return BaseClass::getPreferredTagPoolSize() + 1;
}
@@ -447,6 +466,7 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
TaskCountType latestSentTaskCountValueDuringFlush = 0;
WaitParams latestWaitForCompletionWithTimeoutWaitParams{0};
WaitUserFenceParams waitUserFenecParams;
WriteMemoryParams writeMemoryParams;
TaskCountType flushBcsTaskReturnValue{};
LinearStream *lastFlushedCommandStream = nullptr;

View File

@@ -103,8 +103,8 @@ struct MockAubCsr : public AUBCommandStreamReceiverHw<GfxFamily> {
batchBufferGpuAddressPassed = batchBufferGpuAddress;
}
void writeMemoryWithAubManager(GraphicsAllocation &graphicsAllocation) override {
CommandStreamReceiverSimulatedHw<GfxFamily>::writeMemoryWithAubManager(graphicsAllocation);
void writeMemoryWithAubManager(GraphicsAllocation &graphicsAllocation, bool isChunkCopy, uint64_t gpuVaChunkOffset, size_t chunkSize) override {
CommandStreamReceiverSimulatedHw<GfxFamily>::writeMemoryWithAubManager(graphicsAllocation, isChunkCopy, gpuVaChunkOffset, chunkSize);
writeMemoryWithAubManagerCalled = true;
}

View File

@@ -33,8 +33,8 @@ class MockTbxCsr : public TbxCommandStreamReceiverHw<GfxFamily> {
initializeEngineCalled = true;
}
void writeMemoryWithAubManager(GraphicsAllocation &graphicsAllocation) override {
CommandStreamReceiverSimulatedHw<GfxFamily>::writeMemoryWithAubManager(graphicsAllocation);
void writeMemoryWithAubManager(GraphicsAllocation &graphicsAllocation, bool isChunkCopy, uint64_t gpuVaChunkOffset, size_t chunkSize) override {
CommandStreamReceiverSimulatedHw<GfxFamily>::writeMemoryWithAubManager(graphicsAllocation, isChunkCopy, gpuVaChunkOffset, chunkSize);
writeMemoryWithAubManagerCalled = true;
}