Allow Device creating multiple CSRs [8/n]

Use OsContextId instead of DeviceIndex for residency

Change-Id: Ib2367b32b5b3e320252d8254f1042f1c3d497068
This commit is contained in:
Dunajski, Bartosz
2018-12-03 10:05:36 +01:00
committed by sys_ocldev
parent 3dd13e08a6
commit b728526c4e
55 changed files with 311 additions and 245 deletions

View File

@@ -22,13 +22,13 @@ ScratchSpaceControllerBase::ScratchSpaceControllerBase(const HardwareInfo &info,
void ScratchSpaceControllerBase::setRequiredScratchSpace(void *sshBaseAddress,
uint32_t requiredPerThreadScratchSize,
uint32_t currentTaskCount,
uint32_t deviceIdx,
uint32_t contextId,
bool &stateBaseAddressDirty,
bool &vfeStateDirty) {
size_t requiredScratchSizeInBytes = requiredPerThreadScratchSize * computeUnitsUsedForScratch;
if (requiredScratchSizeInBytes && (!scratchAllocation || scratchSizeBytes < requiredScratchSizeInBytes)) {
if (scratchAllocation) {
scratchAllocation->updateTaskCount(currentTaskCount, deviceIdx);
scratchAllocation->updateTaskCount(currentTaskCount, contextId);
csrAllocationStorage.storeAllocation(std::unique_ptr<GraphicsAllocation>(scratchAllocation), TEMPORARY_ALLOCATION);
}
scratchSizeBytes = requiredScratchSizeInBytes;