mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
Preemption - SIP command programming
Change-Id: I4c7c805a77a9decb8f13d39055bfb2590209ca3e
This commit is contained in:
committed by
sys_ocldev
parent
6272c3ee65
commit
d290955a57
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user