Make partitioned post sync operations for partitioned workloads

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2021-09-03 11:42:31 +00:00
committed by Compute-Runtime-Automation
parent 86f8150dc7
commit 6b299a3ab0
22 changed files with 359 additions and 56 deletions

View File

@@ -37,9 +37,15 @@ ze_result_t FenceImp::queryStatus() {
csr->downloadAllocations();
}
uint64_t *hostAddr = static_cast<uint64_t *>(allocation->getUnderlyingBuffer());
void *hostAddr = static_cast<uint64_t *>(allocation->getUnderlyingBuffer());
uint32_t queryVal = Fence::STATE_CLEARED;
memcpy_s(static_cast<void *>(&queryVal), sizeof(uint32_t), static_cast<void *>(hostAddr), sizeof(uint32_t));
for (uint32_t i = 0; i < partitionCount; i++) {
memcpy_s(static_cast<void *>(&queryVal), sizeof(uint32_t), hostAddr, sizeof(uint32_t));
if (queryVal == Fence::STATE_CLEARED) {
break;
}
hostAddr = ptrOffset(hostAddr, CommandQueueImp::addressOffset);
}
return queryVal == Fence::STATE_CLEARED ? ZE_RESULT_NOT_READY : ZE_RESULT_SUCCESS;
}

View File

@@ -47,8 +47,13 @@ struct Fence : _ze_fence_handle_t {
return allocation->getGpuAddress();
}
void setPartitionCount(uint32_t newPartitionCount) {
partitionCount = newPartitionCount;
}
protected:
NEO::GraphicsAllocation *allocation = nullptr;
uint32_t partitionCount = 1;
};
struct FenceImp : public Fence {