Add function to create devices bitfield based on allocation properties

Change-Id: Ic70443b1fb6106186efcff318690e434dc1db625
Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
This commit is contained in:
Jablonski, Mateusz
2019-02-20 14:03:04 +01:00
committed by sys_ocldev
parent ce77425428
commit 798137e4bb
10 changed files with 53 additions and 5 deletions

View File

@@ -121,6 +121,10 @@ MemoryManager *CommandStreamReceiver::getMemoryManager() const {
return executionEnvironment.memoryManager.get();
}
bool CommandStreamReceiver::isMultiOsContextCapable() const {
return executionEnvironment.specialCommandStreamReceiver.get() == this;
}
LinearStream &CommandStreamReceiver::getCS(size_t minRequiredSize) {
if (commandStream.getAvailableSpace() < minRequiredSize) {
// Make sure we have enough room for a MI_BATCH_BUFFER_END and any padding.
@@ -133,7 +137,7 @@ LinearStream &CommandStreamReceiver::getCS(size_t minRequiredSize) {
auto allocationType = GraphicsAllocation::AllocationType::COMMAND_BUFFER;
auto allocation = internalAllocationStorage->obtainReusableAllocation(minRequiredSize, allocationType).release();
if (!allocation) {
allocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({minRequiredSize, allocationType});
allocation = getMemoryManager()->allocateGraphicsMemoryWithProperties({true, minRequiredSize, allocationType, isMultiOsContextCapable()});
}
//pass current allocation to reusable list

View File

@@ -173,6 +173,7 @@ class CommandStreamReceiver {
void setDisableL3Cache(bool val) {
disableL3Cache = val;
}
bool isMultiOsContextCapable() const;
protected:
void cleanupResources();

View File

@@ -62,7 +62,7 @@ void ExperimentalCommandBuffer::getCS(size_t minRequiredSize) {
auto allocationType = GraphicsAllocation::AllocationType::COMMAND_BUFFER;
GraphicsAllocation *allocation = storageWithAllocations->obtainReusableAllocation(requiredSize, allocationType).release();
if (!allocation) {
allocation = memoryManager->allocateGraphicsMemoryWithProperties({requiredSize, allocationType});
allocation = memoryManager->allocateGraphicsMemoryWithProperties({true, minRequiredSize, allocationType, commandStreamReceiver->isMultiOsContextCapable()});
}
// Deallocate the old block, if not null
auto oldAllocation = currentStream->getGraphicsAllocation();