mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-31 20:13:04 +08:00
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:
committed by
sys_ocldev
parent
ce77425428
commit
798137e4bb
@@ -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
|
||||
|
||||
@@ -173,6 +173,7 @@ class CommandStreamReceiver {
|
||||
void setDisableL3Cache(bool val) {
|
||||
disableL3Cache = val;
|
||||
}
|
||||
bool isMultiOsContextCapable() const;
|
||||
|
||||
protected:
|
||||
void cleanupResources();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user