Preemption - SIP command programming

Change-Id: I4c7c805a77a9decb8f13d39055bfb2590209ca3e
This commit is contained in:
Chodor, Jaroslaw
2018-01-08 15:58:02 +01:00
committed by sys_ocldev
parent 6272c3ee65
commit d290955a57
28 changed files with 661 additions and 90 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -238,6 +238,13 @@ IndirectHeap &CommandQueue::getIndirectHeap(IndirectHeap::Type heapType,
minHeapSize -= MemoryConstants::pageSize;
}
size_t reservedSize = 0;
if (heapType == IndirectHeap::INSTRUCTION) {
reservedSize = alignUp(device->getCommandStreamReceiver().getInstructionHeapCmdStreamReceiverReservedSize(),
MemoryConstants::cacheLineSize);
}
minRequiredSize += reservedSize;
minRequiredSize = minRequiredSize ? std::max(minRequiredSize, minHeapSize) : 0;
minRequiredSize = minRequiredSize > 0 ? alignUp(minRequiredSize, MemoryConstants::cacheLineSize) : 0;
@@ -255,6 +262,11 @@ IndirectHeap &CommandQueue::getIndirectHeap(IndirectHeap::Type heapType,
heap = new IndirectHeap(heapMemory);
heap->overrideMaxSize(minRequiredSize);
}
if (heapType == IndirectHeap::INSTRUCTION) {
device->getCommandStreamReceiver().initializeInstructionHeapCmdStreamReceiverReservedBlock(*heap);
heap->align(MemoryConstants::cacheLineSize);
}
}
return *heap;